Tonight's goal: choose the pattern under pressure, say the approach and complexity out loud, then code one normal linked-list problem plus Reorder List, which counts double.
“Reversal is re-aiming one arrow per step; save next before you break the link so you don't lose the rest.”
2. Where does dummy-node trick help?
“A fake head node means the real first node is never a special case, so the loop body handles every node the same way.”
3. Spot the Floyd bug: while fast: fast = fast.next.next
“Move one pointer twice as fast; inside a cycle the gap shrinks by one each step, so they must eventually meet.”
4. When leader reaches the end, trailer is where?
“Lead one pointer n steps ahead, then walk both together; when the leader hits the end, the trailer sits at the target.”
5. Which order matches Reorder List?
“Hard problems are compositions: find the middle, reverse the second half, then merge the two halves alternately.”
6. What does old_to_new map preserve?
“A hashmap from old node to new node lets you wire up arbitrary pointers in a second pass after all clones exist.”
Self-check gate
Pass tonight if all three are true
You stated the pattern, approach, and complexity before coding each attempt.
The normal problem passed within its timer, without solution text.
Reorder List either passed or reached the correct split, reverse, and alternate-merge structure within 30 minutes.
If any gate fails, write WA: <broken invariant or pointer mistake> in the tracker and add that failed problem to the next revision day. If Reorder List fails, it goes into revision even if the normal problem passed.