User:Nils Grimsmo/LCS bt

The following example uses the functions from Longest common subsequence problem.

X = "AATCC" Y = "ACACG" m = len(X) n = len(Y) C = LCS(X, Y) print "Some LCS: '%s'" % backTrack(C, X, Y, m, n) print "All LCSs: %s" % backTrackAll(C, X, Y, m, n)

It prints the following:

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