Binary Search Trees: Order, Search & Balance

Binary Search Trees: Order, Search & Balance

Week 11 notes: a BST keeps values ordered so search, insert, and delete are O(h). The invariant, why inorder comes out sorted, and why balance is everything.

Binary Trees: Traversals & DFS / BFS

Binary Trees: Traversals & DFS / BFS

Week 10 notes: binary trees are basically recursion you can draw. The three DFS orders, level-order BFS, and the one move that solves most tree problems.

Recursion II: Divide & Conquer, Memoization

Recursion II: Divide & Conquer, Memoization

Week 9 notes: two ideas that take recursion from cute to actually powerful. Splitting problems in half, and caching subproblems so you never redo work.

Recursion I: Base Cases & the Call Stack

Recursion I: Base Cases & the Call Stack

Week 8 notes: recursion felt like magic until I actually pictured the call stack. Writing correct base cases, trusting the recursive call, and reading recurrences.

Linked Lists: Traversal, Reversal & Cycles

Linked Lists: Traversal, Reversal & Cycles

Week 7 notes: linked lists trade O(1) indexing for O(1) splicing. The pointer-rewiring patterns I keep needing: reversal, fast/slow pointers, cycles, and the dummy head.