Dynamic Programming: Patterns & Optimization

Dynamic Programming: Patterns & Optimization

Week 26, the finale. A tour of the DP families that cover most interview questions (knapsack, subsequences, grids, intervals), plus rolling-array space optimization.

Backtracking: Permutations, Combinations & Pruning

Backtracking: Permutations, Combinations & Pruning

Week 25 notes: turning the Week 17 template into a toolkit. The three shapes (subsets, combinations, permutations), handling duplicates without dupes, and the pruning that keeps it feasible.

Graphs: Shortest Paths & Dijkstra

Graphs: Shortest Paths & Dijkstra

Week 24 notes: once edges have weights, plain BFS isn't enough. Picking between BFS, 0-1 BFS, Dijkstra, and Bellman-Ford, plus topological sort for dependency ordering.

Advanced Heap & Priority Queue

Advanced Heap & Priority Queue

Week 23 notes: heaps at interview-hard level. The two-heap running median, k-way merge, greedy scheduling with a priority queue, and the lazy-deletion trick for removing stale entries.

Advanced Binary Tree & BST

Advanced Binary Tree & BST

Week 22 notes: the harder tree problems, where a node has to report several facts to its parent at once. The return-tuple DFS pattern, lowest common ancestor, path sums, and serialize/deserialize.