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
uint64_tuint32_t Pairs(MATCHES& matches, shared_ptr<Pair> *pairs) {
auto trace = pairs != nullptr;
PAIRS traces;
Line 471:
}
 
string Select(shared_ptr<Pair> pairs, uint64_tuint32_t length,
bool right, const string& s1, const string& s2) {
string buffer;
buffer.reserve((uint32_t)length);
for (auto next = pairs; next != nullptr; next = next->next) {
auto c = right ? s2[next->index2] : s1[next->index1];
159

edits