Dynamic Programming21 sections · 916 units
Open in Course

What's Next

Preview of D&C Optimization

You've learned DP with various state spaces: sequences, grids, trees, digits, games, probabilities. Now we'll improve DP transitions.

Many DPs have O(n2)O(n^2) or O(n3)O(n^3) transitions that can be sped up. Divide & Conquer improvement uses the fact that optimal split points are monotonic. Knuth's improvement is similar. These techniques don't change what you compute, just how fast. Learn the DP concepts first; improvement is the polish.