|
|
|
|
|
by Cyph0n
2656 days ago
|
|
Based on my understanding, the key difference with DP is that you build the solution bottom up instead of top-down. For example, in case of computing the factorial of 10 recursively, you would start at fact(10) and move down to the base case, fact(1). With DP, you would start with fact(1) and compute succesive results based on computed ones, all the way up to fact(10). Following on from this, you usually build up the solution in an array, sequentially, instead of navigating down the tree of solutions and storing as you go (memoization). |
|