Print longest common subsequence string of two string
The longest subsequence problem (LCS) is the problem in which we need to find the longest subsequence present in two sequences. In this case, characters doesn’t require to be in consecutive places.
For eg:
LCS for sequence “ABCDFG” and “ABCGDFG” is “ABCDFG” and its length is 6.
For calculating longest common subsequence length we can use recursion or dynamic programming, here we are going to see how to find the longest common subsequence string.
(more…)