T
- It is assumed that this implements equals()
.public class LongestCommonSubsequence<T extends Comparable<T>> extends Object
NOTE: This implements a naive dynamic program and can be improved in terms of memory usage by maintaining only the current row of the dynamic programming table and by using a hash table to store only non-zero values of that row.
Jul 7, 2009
Constructor and Description |
---|
LongestCommonSubsequence() |
Modifier and Type | Method and Description |
---|---|
protected double |
compareTokens(T tok1,
T tok2) |
static List<IntPair> |
getCharacterLCS(String s1,
String s2) |
static Map<Integer,Integer> |
getCharacterLCSMap(String s1,
String s2) |
List<IntPair> |
getLCSMatch(List<T> seq1,
List<T> seq2) |
List<IntPair> |
getLCSMatch(T[] seq1,
T[] seq2) |
Map<Integer,Integer> |
getLCSMatchMap(List<T> seq1,
List<T> seq2) |
Map<Integer,Integer> |
getLCSMatchMap(T[] seq1,
T[] seq2) |
Copyright © 2017. All rights reserved.