English

Pattern-defeating Quicksort

Data Structures and Algorithms 2021-06-10 v1

Abstract

A new solution for the Dutch national flag problem is proposed, requiring no three-way comparisons, which gives quicksort a proper worst-case runtime of O(nk)O(nk) for inputs with kk distinct elements. This is used together with other known and novel techniques to construct a hybrid sort that is never significantly slower than regular quicksort while speeding up drastically for many input distributions.

Cite

@article{arxiv.2106.05123,
  title  = {Pattern-defeating Quicksort},
  author = {Orson R. L. Peters},
  journal= {arXiv preprint arXiv:2106.05123},
  year   = {2021}
}

Comments

20 pages, 10 figures

R2 v1 2026-06-24T03:00:44.935Z