Longest common subsequence: Difference between revisions

Content added Content deleted
(Renamed prefixEnd deque. Improved preferNextIndex2 comment.)
m (Added link to further C++ examples.)
Line 507: Line 507:
class LCS {
class LCS {
protected:
protected:
// This linked list class is used to trace the LCS candidates
// Instances of the Pair linked list class are used to recover the LCS:
class Pair {
class Pair {
public:
public:
Line 658: Line 658:
auto s = lcs.Correspondence(s1, s2);
auto s = lcs.Correspondence(s1, s2);
cout << s << endl;</syntaxhighlight>
cout << s << endl;</syntaxhighlight>

More fully featured examples are available at [https://github.com/CNHume/Samples/tree/master/C%2B%2B/LCS Samples/C++/LCS].


=={{header|Clojure}}==
=={{header|Clojure}}==