Dynamic Programming — Part I
Dynamic Programming — Lecture Notes 1. What Is Dynamic Programming? Dynamic programming (DP) is an algorithmic paradigm for solving problems that have overlapping subproblems and optimal substructure. Overlapping subproblems: the subproblems are smaller versions of the original problem. Optimal substructure: the optimal solution to a larger problem contains the optimal solutions to its smaller problems, so the larger problem can be derived from the smaller ones. 2. Example: Climbing Stairs A staircase has $n$ steps. Each move, you can climb 1 or 2 steps. How many distinct ways are there to reach the top?
Read note →