Package com.zybooks.dsaj.text
Class LCS
java.lang.Object
com.zybooks.dsaj.text.LCS
Algorithms for computing the longest common subsequence of two character sequences.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int[][]
LCS
(char[] X, char[] Y) Returns table such that L[j][k] is length of LCS for X[0..j-1] and Y[0..k-1].static char[]
reconstructLCS
(char[] X, char[] Y, int[][] L) Returns the longest common substring of X and Y, given LCS table L.
-
Constructor Details
-
LCS
public LCS()
-
-
Method Details
-
LCS
public static int[][] LCS(char[] X, char[] Y) Returns table such that L[j][k] is length of LCS for X[0..j-1] and Y[0..k-1]. -
reconstructLCS
public static char[] reconstructLCS(char[] X, char[] Y, int[][] L) Returns the longest common substring of X and Y, given LCS table L.
-