

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Edit Distance
incomplete
2: Slow Edit Distance
incomplete
3: Edit Distance
incomplete
4: Dynamic Programming Edit Distance
incomplete
5: Fast Edit Distance – Review
incomplete
6: Memoization vs. Tabulation – Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
If the larger problem requires all of the subproblems to be solved, tabulation usually outperforms memoization by a constant factor. Tabulation has no overhead for recursion and can use a preallocated array rather than a hash map.
If only some of the subproblems need to be solved for the overall problem to be solved, then memoization is preferable because the subproblems are solved lazily. There's no need to compute subproblems that turn out to be irrelevant.