Quicksort Is Optimal For Many Equal Keys
Sebastian Wild

TL;DR
This paper proves that median-of-$k$ Quicksort with three-way partitioning is asymptotically optimal for sorting multisets with many duplicates, resolving a long-standing conjecture and advancing the analysis of Quicksort's efficiency with equal elements.
Contribution
It establishes the asymptotic optimality of median-of-$k$ Quicksort for multisets with many duplicates, confirming a conjecture by Sedgewick and Bentley.
Findings
Average comparisons are within a constant factor of the lower bound for many duplicates.
The constant factor approaches 1 as $k$ increases, indicating near-optimality.
First progress on Quicksort analysis with equal elements since 1977.
Abstract
I prove that the average number of comparisons for median-of- Quicksort (with fat-pivot a.k.a. three-way partitioning) is asymptotically only a constant times worse than the lower bound for sorting random multisets with duplicates of each value (for any ). The constant is , which converges to 1 as , so Quicksort is asymptotically optimal for inputs with many duplicates. This resolves a conjecture by Sedgewick and Bentley (1999, 2002) and constitutes the first progress on the analysis of Quicksort with equal elements since Sedgewick's 1977 article.
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
TopicsLimits and Structures in Graph Theory · Algorithms and Data Compression · Complexity and Algorithms in Graphs
