Recursion and DP for coding interviews
summary
Step‑by‑step proofs and runnable techniques: a recursive height-of-binary-tree solution that reduces to a single max+1 line and runs in O(n), a matrix max‑sum path shown as top‑down recursion that suffers repeated work unless each cell is memoized (cache keyed by row,col), and a bottom‑up DP filling the grid as an alternative. Demonstrates the repeated‑work pitfall when subproblems overlap, gives implementation size estimates like five lines for the recursive version, and stresses practice (tens to hundreds of problems) to internalize these patterns.
AI-written summary · about
