Linked Lists
Implement singly and doubly linked lists and rewire node references safely for reversal, merging and cycle detection.
4 objectives 6 steps about 125 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Implement singly and doubly linked lists with a sentinel node, supporting O(1) insertion and deletion at a known node.
- Reverse, merge and split linked lists by rewiring references, sketching before and after states so no node is lost.
- Use fast and slow pointers to find the middle node and detect a cycle, and explain why the pointers must meet.
- Compare linked lists with dynamic arrays and collections.deque for a given access pattern and justify the choice.
Lesson plan
6 steps, about 125 min · 5 of 5 lessons available so far
- Nodes, References and Sentinels Concept · 20 min
- Lab: A Doubly Linked List with a Sentinel Lab · 30 min
- Reference Surgery: Reverse, Merge, Split Worked example · 25 min
- Two Speeds Through One List Worked example · 20 min
- Lists, Arrays or Deques? Concept · 15 min
- Check: Linked List Exercises Knowledge check · 8 questions
Practise it
Build an LRU cache with O(1) get and put from a dict plus your doubly linked list, and pass tests covering eviction order, updates to existing keys and capacity 1.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Memory AllocatorIntermediate · 6–12 h
- Build your own BlockchainIntermediate · 8–16 h
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.