public class LongestCommonSubsequence extends Object implements StringDistance
Constructor and Description |
---|
LongestCommonSubsequence() |
Modifier and Type | Method and Description |
---|---|
double |
distance(String s1,
String s2)
Return the LCS distance between strings s1 and s2,
computed as |s1| + |s2| - 2 * |LCS(s1, s2)|
|
protected int |
length(String s1,
String s2)
Return the length of Longest Common Subsequence (LCS) between strings s1
and s2.
|
static void |
main(String[] args) |
public static void main(String[] args)
args
- the command line argumentspublic double distance(String s1, String s2)
distance
in interface StringDistance
s1
- s2
- Copyright © 2015. All rights reserved.