Strategies for Stable Merge Sorting
Sam Buss, Alexander Knop

TL;DR
This paper introduces new stable merge sort algorithms, $2$-merge and $eta$-merge sorts, providing tight bounds on their merge costs, which outperform existing sorts like Timsort in worst-case scenarios and are easier to implement.
Contribution
The paper presents two novel stable merge sort algorithms with optimal bounds and improved practical performance, expanding the theoretical understanding of merge costs in sorting.
Findings
$2$-merge sort has approximately 1.089 n log m merge cost.
New algorithms outperform Timsort in worst-case merge cost.
Experimental results show better performance of new sorts over existing algorithms.
Abstract
We introduce new stable natural merge sort algorithms, called -merge sort and -merge sort. We prove upper and lower bounds for several merge sort algorithms, including Timsort, Shivers' sort, -stack sorts, and our new -merge and -merge sorts. The upper and lower bounds have the forms and for inputs of length~ comprising ~monotone runs. For Timsort, we prove a lower bound of . For -merge sort, we prove optimal upper and lower bounds of approximately . We prove similar asymptotically matching upper and lower bounds for -merge sort, when , where is the golden ratio. Our bounds are in terms of merge cost; this upper bounds the number of comparisons and accurately models runtime. The merge strategies can be used for any stable…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Natural Language Processing Techniques · Network Packet Processing and Optimization
