4 ms·
Memoization and dynamic programming are not exactly the same. Memoization wins when the filled-in part of the table is expected to be sparse. Because dynamic p
by psykotic 16y ago
Memoization and dynamic programming are not exactly the same.
Memoization wins when the filled-in part of the table is expected to be sparse. Because dynamic programming works bottom up, it always fills in the entire table.
Memoization's downside is that it uses a lot of memory. For the simple variant of the edit-distance problem it uses O(n^2) memory as opposed to O(n) memory with dynamic programming. In relation to this, the cache behavior and other constant factor overhead is usually much worse with memoization.