Dynamic programming: never solve the same thing twiceLesson 2 of 6Free preview

Remember the answer: memo or table

Plain fib(6) makes 25 calls for 7 questions; with a memo it makes 11. Top-down memoisation against bottom-up tabulation.