Econometrica Vol. 36 No. 2 1968
Introduction to Dynamic Programming
Abstract
Already, fib(5) is being called and recomputed 3 different times. To speed up our naive solution, we can employ DP by computing fib() for each value up to n=10 and storing it for future use. One way we can implement this is to slightly modify our original recursive function to check a table to see if we’ve already computed that specific Fibonacci number. If we have, we use it, otherwise we compute and then store it. This is the top-down approach(also called memoization) because start from the overall problem and recurse down until we reach the smallest subproblems (the base cases).
- DOI
- 10.2307/1907500
- Volume
- 36
- Issue
- 2
- Pages
- 422
- Sources
- semanticscholar openalex crossref