Linked Lists mind map

Rewiring nodes, fast & slow pointers, and list tricks.

Core idea: Node identity matters; save next before changing any arrow.

Mnemonic: Save → rewire → advance · Cost: O(n) time · O(1) pointer space

Guard: Dummy head

Signal: The head might be inserted, removed, or replaced.

Move: Put a stable sentinel before the real list so every mutation has a predecessor.

Examples: Merge Two Lists, Remove Nth Node, Partition List

Flip: Pointer reversal

Signal: Links must reverse wholly, in a range, or in fixed groups.

Move: Carry prev, curr, next; reconnect the reversed region to both untouched boundaries.

Examples: Reverse List, Reverse Between, Reverse K Group

Race: Fast & slow

Signal: You need a midpoint, cycle, or repeated state without extra memory.

Move: Let speed difference reveal the meeting; reset one pointer when locating cycle entry.

Examples: Middle of List, Linked List Cycle II, Find Duplicate

Align: Merge, identity & cloning

Signal: Lists converge, interleave, or carry non-next references.

Move: Equalize remaining distance, merge frontiers, or map originals before wiring copies.

Examples: Intersection of Lists, Merge K Lists, Copy Random List

Every mind map