Dynamic Programming [00QG]

We now turn to study "dynamic programming"---which is really neither dynamic, nor programming (at least not in the current sense). The name was chosen by Richard Bellman in 1950 as something that sounded good to funding agencies; but the name stuck!

Previously we studied the divide and conquer technique, where a problem gets broken down recursively into subproblems. We’re still considering the same phenomenon—dynamic programming is about what to do when the recursive subproblems overlap. A naïve recursive implementation will thus end up being called on the same inputs multiple times, which is wasteful (sometimes dramatically so!). The basic idea is to save answers to recursive subproblems (memoization) so we don’t have to compute them more than once. Dynamic programming has a reputation for being difficult and confusing, but at heart it’s just this simple idea.

Context

Algorithms Fall 2026 lecture notes [00JF]

Related

Divide and Conquer [00PJ]