Reorder List
Reorder nodes first, last, second, second-last, in place.
Why does this pattern fit?
Restate the exact job
Reorder nodes first, last, second, second-last, in place.
The target order interleaves the first half with the reversed second half.
O(n) time · O(1) space
Not severing the halves can create a cycle.
How to solve Reorder List
The goal is to solve this problem from the pattern, not to memorize a finished answer. Use this as a check after your own attempt.
What the question asks
Reorder nodes first, last, second, second-last, in place.
Why Linked-list rewiring fits
The target order interleaves the first half with the reversed second half.
State to maintain
Middle pointer, two half heads, and saved next references.
Transition
Find the middle, reverse the second half, then weave alternating nodes.
Time and space
O(n) time · O(1) space
Counterexample to the tempting mistake
Not severing the halves can create a cycle.
Prove it again tomorrow
Close this page. Rebuild the state and transition from memory, write a test that exposes the mistake above, then solve a fresh input without looking back. A same-day reread is practice, not proof of retention.