LongestCommonSubstring Class |
The LongestCommonSubstring class provides a client for computing the longest common substring that appears in two given strings.
This implementation computes the suffix array of each string and applies a merging operation to determine the longest common substring. For an alternate implementation, see LongestCommonSubstringConcatenate.java.
Namespace: Algs4Net
public class LongestCommonSubstring
The LongestCommonSubstring type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Lcs |
Returns the longest common string of the two specified strings.
|
![]() ![]() | MainTest |
Demo test the Lcs() client.
Reads in two strings from files specified as command-line arguments;
computes the longest common substring; and prints the results to
standard output. |
For additional documentation, see Section 6.3 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
This class is a C# port from the original Java class LongestCommonSubstring implementation by the respective authors.