Learning path / 12 published lessons
Data structures and algorithmic foundations
Build arrays, linked structures, trees, heaps and graphs into a vocabulary of costs and invariants. Use that vocabulary to reason about search, recursion and dynamic programming.
What you’ll work toward
- Corrected the two-pointer elimination proof: nums[left] is the smallest remaining partner for nums[right]
- MiniHashMap now validates power-of-two capacity and searches past a tombstone for an existing key before reusing it; otherwise updating a colliding key can create duplicates
- Linked-list operations assume acyclic disjoint lists except explicit cycle tests and require valid removal positions
- Deque front removal is approximately O(1); list append/pop at the end are amortized where resize applies
Completion is stored on this device only. Nothing is locked; start where it makes sense.
Start this pathBefore the first lesson
- Read the prerequisite section and complete its exercises
These are the starting lesson’s prerequisites, not requirements for every advanced topic below.
How to practise this subject
Draw the structure before and after an update. Check empty, singleton and repeated-value cases, and account separately for time, auxiliary storage and the returned result.
- 01
Arrays & Strings — Indexing, Slicing, Two-Pointer
The two data structures every algorithm question secretly starts from — and the two-pointer template that solves half of them in O(n).
- 02
Hashmaps & Sets — Hash Functions, Collisions
The single data structure that turns O(n) loops into O(1) lookups — how it actually works under the hood, why it can go pathologically slow, and the design review patterns you must own.
- 03
Linked Lists — Singly, Doubly, When They Win
The data structure reviewers still love — plus the three real-world situations where a linked list actually beats an array.
- 04
Stacks & Queues — LIFO/FIFO in Practice
The two most important restricted data structures — and how they secretly power your function calls, browser history, printer queues, BFS, and every parser you've ever used.
- 05
Recursion — Call Stack, Base Case, Worked Examples
The mental model for solving problems by solving smaller versions of themselves — plus the tricks (memoisation, tail-form, iterative rewrites) that make it survive production.
- 06
Trees & BSTs — Traversal (BFS/DFS)
Trees are the recursive data structure that models everything hierarchical — DOM, filesystems, syntax, dependency graphs. Master traversal and balancing here, and every future algorithm gets easier.
- 07
Heaps & Priority Queues
The data structure behind top-K, Dijkstra, event schedulers, and every job runner — how heapq works, when to use it, and the classic patterns that come up in serious production work.
- 08
Graphs — Representation, BFS, DFS, Shortest Path
The most general data structure — and the algorithms that turn ‘find the shortest / cheapest / connected’ problems into 20-line functions.
- 09
Sorting — Merge, Quick, and When to Trust the Built-in
The three sorts everyone should know (merge, quick, heap), why Python's sorted() beats them all, and the practice problems that ask you to implement them anyway.
- 10
Binary Search — the Pattern Behind 100 Problems
Sorted (or monotonic) + halving = O(log n). One template, three shapes: classic search, lower/upper bound, and binary-search-on-the-answer. The pattern behind git bisect, B-tree lookups, ship-in-D-days, and half the LeetCode medium set.
- 11
Dynamic Programming — Memoisation & Tabulation
Break the problem down, cache the answer. Overlapping subproblems + optimal substructure = polynomial time from exponential recursion. Two dialects (top-down memo, bottom-up tabulation), one recipe (state → transition → base case → order), and the classic classics: Fibonacci, climbing stairs, coin change, LIS, edit distance.
- 12
Greedy & Backtracking — When to Use Each
Two decision-making patterns that live either side of DP. Greedy: bet on the best local move and never look back — fast, occasionally wrong. Backtracking: explore every option and undo dead ends — slow, always right. Learn to prove greedy is safe, prune backtracking aggressively, and pick the right tool in 30 seconds.