Longest common subsequence: Difference between revisions
m
Clarified preferNextIndex2 optimization to the Hunt and Szymanski algorithm.
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (Clarified preferNextIndex2 optimization to the Hunt and Szymanski algorithm.) |
||
Line 573:
//
// Look ahead to the next index2 value to optimize
// and Szymanski algorithm. If the next index2 is also an improvement on
// the value currently held in threshold[index3], a new Pair will only be
// superseded on the next index2 iteration.
//
//
//
//
auto
(limit == threshold.begin() || *prev(limit) < *next(it2));
//
// Depending on match redundancy, this optimization may reduce the number
// of Pair allocations by factors ranging from 2 up to 10 or more.
//
if (skipIndex2) continue;
|