You are viewing a single comment's thread. Return to all comments →
Exactly! i had never solved LCS non recursively. Quite interesting.
see CLRS intro to algorithms 3ed chapter 15, which discusses the two types of DP approaches: top down recursive, and bottom up iterative. The bottom-up approach builds a table starting from the simplest solutions, and that's the approach that is necessary here.