Day 28 — Revision: Linked List week

revision day · linked lists · blank file, no hints

Tonight's goal: prove the linked-list pointer moves can come back from memory under pressure.

Tonight's protocol

Use the revision-day protocol: only a blank-file pass on run one or two counts.

  1. 0:00-0:05: scan the menu, answer the warm-up MCQs, and pick your 3 weakest problems.
  2. 0:05-0:30: Problem 1. Say the invariant, brute force, and target complexity out loud; code from a blank file with no hints.
  3. 0:30-0:55: Problem 2. Same rule: no notes, no stored code, no video, no editor history.
  4. 0:55-1:20: Problem 3. Stop after run two; a later pass does not count as revision done.
  5. 1:20-1:30: for every miss, write WA: <root cause> and add that problem to the next revision queue.

The problem menu

Pick your 3 weakest from this menu. Re-solve each from a blank file, no hints.

ProblemPattern name
Reverse Linked Listprev/curr/next
Merge Two Sorted ListsThe dummy node trick
Linked List CycleFloyd's fast/slow pointers
Remove Nth Node From End of ListGap Pointers: n Apart
Reorder ListComposing Linked-List Primitives
Copy List with Random PointerCloning with a map

Warm-up MCQs

1. Which safety rule belongs to Reverse Linked List?

2. Which invariant removes the head special case?

3. Spot the bug in this cycle loop:

while fast:
    slow = slow.next
    fast = fast.next.next

4. Which plan finds a node measured from the end?

5. Which invariant matches Reorder List?

6. Which trade belongs to Copy List with Random Pointer?

Self-check gate

Pass tonightAll 3 chosen problems pass on run one or two, and you can state the chosen invariants without looking.
Fail pathIf any problem needs a hint, fails after run two, or has a pointer mistake, log WA: <root cause> and add it to the next revision.

Final check: reverse 1 -> 2 -> 3 on paper with prev, curr, and nxt. If one arrow is lost, Reverse Linked List goes back into the queue.