LeetCode Β· Linked List

Linked List Problem Set

Pointer manipulation β€” reversals, merges, cycle detection, and reordering. The key: draw the pointers on paper before coding.

Concept page: Linked List
DifficultyPatternProblemKey Insight
EasyreversalLC 206 Β· Reverse Linked ListIterative three-pointer swap. O(n).
EasymergeLC 21 Β· Merge Two Sorted ListsDummy head, compare and link. O(n + m).
Easyfast-slowLC 141 Β· Linked List CycleFloyd's tortoise and hare. O(n).
Mediumfast-slowLC 142 Β· Linked List Cycle IIAfter the Floyd meeting point, reset one pointer to head and walk both at the same speed to find the cycle entry.
MediumreorderLC 143 Β· Reorder ListFind middle β†’ reverse second half β†’ merge alternating. O(n).
MediumremovalLC 19 Β· Remove Nth Node From End of ListTwo pointers with n-gap. O(n) one pass.
MediummathLC 2 Β· Add Two NumbersDigit-by-digit addition with carry. O(max(m,n)).
MediumcopyLC 138 · Copy List with Random PointerHashMap old→new, or interleave-then-separate. O(n).
Mediumfast-slowLC 287 Β· Find the Duplicate NumberFloyd's cycle detection on index-value mapping. O(n).
HardmergeLC 23 Β· Merge k Sorted ListsMin-heap of k list heads, or divide-and-conquer merge. O(n log k).

← Back to all LeetCode categories