lcs

LCS algorithm


After pseudo-code in
http://www.ics.uci.edu/~eppstein/161/960229.html
Lecture notes by David Eppstein, eppstein@ics.uci.edu


commonSubseqs: find common subsequences
  a, b: two sequences
returns
  l: list of common subsequences
  m: the length of a
  n: the length of b


longestCommonSubseq: find the LCS of two sequences
The sequence type must have an __append metamethod. This is
provided by string_ext for strings, and by list for lists.
  a, b: two sequences
  s: an empty sequence of the same type
returns
  s_: the LCS of a and b