07
Linked List Reversal
In-place pointer manipulation.
5 pages
- Pattern 07: In-place Reversal of a Linked ListPattern guide
Two skeletons — reverse and dummy head — plus one rule: when a problem might delete or replace the head, allocate a dummy node and you delete an entire…
- LC 21Merge Two Sorted Lists (LC 21)Easy
Use a dummy sentinel node to simplify edge case handling when building a new list
- LC 234Palindrome Linked List (LC 234)Easy
Find middle with fast/slow, reverse second half, compare both halves. Problem walkthrough from the Linked List Reversal pattern set — Java templates…
- LC 83Remove Duplicates from Sorted List (LC 83)Easy
Skip duplicate nodes by modifying next pointers in a single pass. Problem walkthrough from the Linked List Reversal pattern set — Java templates, complexity…
- LC 160Intersection of Two Linked Lists (LC 160)Easy
Two walkers swap lists at the end so both travel the same total length and meet at the shared suffix (or both hit null).