There are 2 ways to solve DP -
1. Top Down approach (a.k.a Memoization) - includes recursion + caching calculated results
2. Bottom Up approach (a.k.a Tabulation) - includes building up a table 1D or 2D to avoid calculating the results multiple times.
1. Top Down approach (a.k.a Memoization) - includes recursion + caching calculated results
2. Bottom Up approach (a.k.a Tabulation) - includes building up a table 1D or 2D to avoid calculating the results multiple times.
No comments:
Post a Comment