Algorithms and Data Structures · Middle · Question 41 of 75
What is the difference between memoization and tabulation?
- 1Memoization is always faster, tabulation always uses less memory
- ✓Correct answer: Memoization caches recursive calls top-down; tabulation fills a table bottom-up
- 3Memoization is for strings, tabulation is for numbers
Explanation
Both compute each subproblem once. Top-down is often easier to write and computes only what's needed; bottom-up avoids deep recursion and makes memory optimizations easier, for example keeping only the last row.