Memoization

Can make the recursive formulation work, as long as you don't let yourself compute the answer to the same question repeatedly.

Turn an exponential algorithm into a quadratic one!


next up previous
Next: OTHER PROBLEMS Up: LONGEST COMMON SUBSEQUENCE Previous: Beam Search