Longest common subsequence: Difference between revisions
m
Redeclared unit32_t Pairs() which returns the maximum LCS length.
(The reverse iterator it2 now visits index2 values in descending order.) |
m (Redeclared unit32_t Pairs() which returns the maximum LCS length.) |
||
Line 375:
// return the LCS as a linked list of matched index pairs
auto trace = pairs != nullptr;
PAIRS traces;
Line 471:
}
string Select(shared_ptr<Pair> pairs,
bool right, const string& s1, const string& s2) {
string buffer;
buffer.reserve(
for (auto next = pairs; next != nullptr; next = next->next) {
auto c = right ? s2[next->index2] : s1[next->index1];
|