Guided Lesson Notes
Understanding Dynamic Programming
Dynamic Programming focuses on overlapping subproblems, reusable answers, and turning recursion into a table or memo. Dynamic programming solves overlapping subproblems by storing results and building answers from smaller states.
Model: define one state as a smaller question whose answer can help build larger answers.
Invariant: when a state is used, every smaller state it depends on must already be correct or memoized.
Implementation: state definitions, recurrence formulas, base cases, table order, memoization maps, and reconstruction when needed.
Use Dynamic Programming when the problem asks for best, count, longest, shortest, ways, or choices over prefixes, positions, capacities, or subsets.
