Algorithm Implementation/Strings/Longest common subsequence

Finding the LCS
The following C# program calculates the longest common subsequence (note the singular) of 2 strings. For example, for the strings "computer" and "houseboat" this algorithm returns a value of 3, specifically the string "out".

Common Lisp
This version only works for lists but can be generalized for all sequences.

Usage example
It prints the following:

Some LCS: 'AAC' All LCSs: set(['ACC', 'AAC'])

Usage example
It prints the following:

+ This is an important notice! It should + therefore be located at the beginning of + this document! +   This part of the document has stayed the same from version to version. - - This paragraph contains text that is - outdated - it will be deprecated and - deleted in the near future. It is important to spell check this - dokument. On the other hand, a misspelled - word isn't the end of the world. + document. On the other hand, a misspelled + word isn't the end of the world. This + paragraph contains important new + additions to this document.

VB.NET
The following VB.NET program calculates the longest common subsequence (note the singular) of 2 strings. For example, for the strings "computer" and "houseboat" this algorithm returns a value of 3, specifically the string "out".

Java
The Java implementation uses two classes. The first, an abstract class that implements the algorithm. The second, an concrete class implementing this for a string. Obviously, you could use this so that instead of comparing characters in a string, it could compare lines in a file, blocks of code, nodes in an XML document, or whatever you choose.

C++
Usage:

Usage example
Include your class file and instantiate a new object of the class by passing both strings to the constructor Access the results by using $obj->remains and $obj->differences

Usage example
Variable D is:

J
See for details.