Ch15: Dynamic Programming Flashcards
Dynamic programming applies when the subproblems…
overlap - that is, when they share sub-subproblems
A dynamic programming algorithm solves each subproblem…
just once, then saves the answer in a table to avoid recomputing it each time it is needed
We typically apply dynamic programming to
optimization problems
4 steps of developing a dynamic programming algorithm
1) CHARACTERIZE the structure of an optimal solution 2) Recursively DEFINE the value of an optimal solution 3) COMPUTE the value of an optimal solution, typically in a bottom-up fashion 4) CONSTRUCT an optimal solution from computed information
Steps 1-3 of developing a DP algorithm form the basis of…
a DP solution to a problem
If we need only the VALUE of an optimal solution and not the solution itself, we can…
omit step 4 (construct an optimal solution)