Papers › Merging Sorted Lists of Similar Strings

Merging Sorted Lists of Similar Strings

19 Aug 2022arXiv:2208.09351links table onlyarchive 2025-07-28

Gene Myers

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

Merging T sorted, non-redundant lists containing M elements into a single sorted, non-redundant result of size N ≥M/T is a classic problem typically solved practically in O(M logT) time with a priority-queue data structure the most basic of which is the simple *heap*. We revisit this problem in the situation where the list elements are *strings* and the lists contain many *identical or nearly identical elements*. By keeping simple auxiliary information with each heap node, we devise an O(M logT+S) worst-case method that performs no more character comparisons than the sum of the lengths of all the strings S, and another O(M log(T/ e̅)+S) method that becomes progressively more efficient as a function of the fraction of equal elements e̅ = M/N between input lists, reaching linear time when the lists are all identical. The methods perform favorably in practice versus an alternate formulation based on a trie.

PaperPDFCode

Code

thegenemyers/string.heap officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections