Takeaways
- Dynamic Programming is an algorithm technique used for optimization problems that involves smartly using recursion to solve a problem with many overlapping subproblems
- All DP problems require optimal substructure, and overlapping subproblems
- In top-bottom DP, we remember answers of previously-solved subproblems with a memoization table
- In bottom-up DP, we calculate all subproblems with a tabulation table filled with a loop
- Dynamic programming is a great way to get a non-polynomial (recusrive) algorithm to polynomial time
- A directed acyclic graph (DAG) is a directed graph with no cycles
Code
April 24th code is a solutions for two different DP problems (Rod Cutting, Taxi Profit). They both use top-down recursive DP.