Myvideo

Guest

Login

06 - Longest Common Subsequence - Recursive approach

Uploaded By: Myvideo
1 view
0
0 votes
0

@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:

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later