Learn Top 10 Dynamic Programming Patterns

KingSuper
1 min readMar 1, 2020
Dynammic Programming Meme

To be really honest with you Dynamic Programming is just recursion with a Cache. The value of recurring states in the recursion are stored in that cache in order not to recalculate the value of those recursive states again.

Once a recursive code is written write, it can easily be converted into DP code just by adding 4 more lines. Moreover there are various group of problems that closely resembles each other. Learning one problem can help you solving other 10 more that resembles it. I have discovered some patterns and techniques that can help you a lot.

Please find below the top 10 Patterns of Dynamic Programming Problems :

1. Matrix Chain Multiplication

2. 0–1 Knapsack

3. Unbounded Knapsack

4. Longest Increasing Sub-sequence

5. Fibonacci

6. Longest Common Sub-sequence

7. Kadane’s Algorithm

8. Dynamic Programming on Trees

9. Dynamic Programming on Grids

10. Some other important problems on Dynamic Programming

--

--