Class LCS

java.lang.Object
com.zybooks.dsaj.text.LCS

public class LCS extends Object
Algorithms for computing the longest common subsequence of two character sequences.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LCS()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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].
    static char[]
    reconstructLCS(char[] X, char[] Y, int[][] L)
    Returns the longest common substring of X and Y, given LCS table L.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.