StringAlgorithmsLongestCommonSubsequence Method |
It differs from problems of finding common substrings: unlike substrings, subsequences are not required to occupy consecutive positions within the original sequences.
LongestCommonSubsequence("BLUB","aBcLeUgBh") = 4 LongestCommonSubsequence("aBcLeUgBh","BLUB") = 4
LongestCommonSubsequence("BLUB","aBcLeUg") = 3 LongestCommonSubsequence("aBcLeUg","BLUB") = 3
Namespace: DHI.Mike1D.Generic
public static int LongestCommonSubsequence( string s, string t )