Linked Lists
No indexes, only arrows. Most linked list bugs are one assignment made too early.
5 lessons · ~50 min
By the end you can
- Read and rewire next pointers without losing the rest of the list
- Reverse a list in place, whole or in part, in one pass
- Use a dummy head to drop the head-is-special branch and to merge sorted lists
- Find the middle and the nth node from the end with two runners
- Pick the right linked list move from the problem statement
Lessons
- 1Follow the arrows8 minWhat a node is, walking a list, and why the front is free while the middle costs a walk.
- 2Reversing in place11 minprev, curr and nxt: the three-pointer reversal, the one line order that works, and reversing only the front.
- 3A dummy head and two lists11 minA throwaway node that deletes the head-is-special branch, and merging two sorted lists by splicing.
- 4Two runners on one list11 minA fixed gap finds the nth node from the end, fast and slow find the middle, and both feed the palindrome check.
- 5Spotting linked list problems9 minRewiring, head-may-change and position cues, the cut-the-tail trap, and when a list is the wrong picture.
Practice it after
Real interview questions that test this pattern, in an editor with execution and AI feedback.