06 - Longest Common Subsequence - Recursive approach

@Rishi Srivastava Break down the problem into subproblems using recursive approach. Pseudo code: If last characters of both sequences match (or text1[row-1] == text2[col-1]) then LCS(text1[], text2[]) = 1 LCS(text1[], text2[]) If last characters of both sequences do not match (or text1[row-1] != text2[col-1]) then LCS(text1[], text2[]) = MAX[text1(LCS(text1[], text2[]), LCS(text1[], text2[]))] Github: Leetcode:
Back to Top