What is the difference between memoization and tabulation?
LeetCode Patterns Flashcards: Dynamic Programming, Memoization, Tabulation, Patterns
Аудио-карточка · 0:26Nortren·
What is the difference between memoization and tabulation?
0:26
Memoization, or top-down DP, starts from the original problem and recursively breaks it into subproblems, caching results in a hash map or array to avoid recomputation. It only solves subproblems that are actually needed. Tabulation, or bottom-up DP, builds a table starting from the smallest subproblems and iteratively fills in larger ones until reaching the answer. It avoids recursion overhead and stack overflow risk. Both produce the same time complexity.
neetcode.io