Magic Spells

  • + 0 comments

    the recursive relation for LCS can naturally be translated to an iterative non-recursive algorithm for successively filling up the memo table of subproblem answers. That can be done with a simple C-style double nested for loop, and doesn't require defining external functions or fancy lambdas / functors.