Dynamic Programming21 sections · 915 units
Open in Course

Section Recap

What we learned

You've learned Slope Trick. You can now solve DP problems with absolute value costs by tracking slope-change points instead of all values. You know:

1.1. Piecewise linear functions are defined by breakpoints.

2.2. Priority queues track these dynamically.

3.3. Transitions shift or merge functions in O(log⁡n)O(\log n) time.

4.4. This turns O(n⋅V2)O(n \cdot V^2) into O(nlog⁡n)O(n \log n). This is one of the harder DP optimizations. If it feels abstract, that's normal. Practice on the three problems above. Good work finishing here.