English

QuickMergesort: Practically Efficient Constant-Factor Optimal Sorting

Data Structures and Algorithms 2018-04-27 v1

Abstract

We consider the fundamental problem of internally sorting a sequence of nn elements. In its best theoretical setting QuickMergesort, a combination Quicksort with Mergesort with a Median-of-n\sqrt{n} pivot selection, requires at most nlogn1.3999n+o(n)n \log n - 1.3999n + o(n) element comparisons on the average. The questions addressed in this paper is how to make this algorithm practical. As refined pivot selection usually adds much overhead, we show that the Median-of-3 pivot selection of QuickMergesort leads to at most nlogn0.75n+o(n)n \log n - 0{.}75n + o(n) element comparisons on average, while running fast on elementary data. The experiments show that QuickMergesort outperforms state-of-the-art library implementations, including C++'s Introsort and Java's Dual-Pivot Quicksort. Further trade-offs between a low running time and a low number of comparisons are studied. Moreover, we describe a practically efficient version with nlogn+O(n)n \log n + O(n) comparisons in the worst case.

Keywords

Cite

@article{arxiv.1804.10062,
  title  = {QuickMergesort: Practically Efficient Constant-Factor Optimal Sorting},
  author = {Stefan Edelkamp and Armin Weiß},
  journal= {arXiv preprint arXiv:1804.10062},
  year   = {2018}
}