Dynamic Programming: An Intro

Dynamic Programming: An Intro

Week 16 notes: DP is just recursion that never repeats work, and it's way less scary than its reputation. Spotting a DP problem, defining a state, and going top-down or bottom-up.

Sorting & Searching Essentials

Sorting & Searching Essentials

Week 15 notes: I rarely write a sort from scratch in an interview, but knowing the trade-offs and the 'sort first, then the problem gets easy' instinct is the real skill.

Graphs 101: BFS & DFS Traversals

Graphs 101: BFS & DFS Traversals

Week 14 notes: a tree is just a graph without cycles. Graph representations, DFS and BFS with a visited set, shortest paths on unweighted graphs, and grids as graphs.

N-ary Trees: Traversal & Encoding

N-ary Trees: Traversal & Encoding

Week 13 notes: once a node can have any number of children, the binary-tree patterns still work, you just loop over children. Plus encoding an N-ary tree as a binary one.

Tries: Prefix Trees for Fast Lookups

Tries: Prefix Trees for Fast Lookups

Week 12 notes: a trie stores strings by shared prefixes, so lookup and prefix search depend on word length, not how many words you've got. Where autocomplete comes from.