Dynamic Programming is all about ordering computations to avoid duplicate work. It is an optimization technique used to optimize code by saving partial results. There are two types of Dynamic Programming: Memoization (Top-Down) and Tabulation (Bottom-Up).

4m read timeFrom towardsdev.com
Post cover image
Table of contents
Dynamic Programming is all about ordering computations in such a way that we avoid recalculating the duplicate work.Here are few observations from the above code:Consider a real life Example to understand more clearly:1 . Memoization or Top-Down :2. Tabulation or Bottom's up:

Sort: