Pattern-defeating Quicksort

Orson R. L. Peters
6/9/2021
cs.DS

Official code: orlp/pdqsort (2,514 stars, C++, Zlib, last commit 2023-12-06).

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)$ for inputs with $k$ 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.

View on arXivView PDF

Code Implementations(1)

orlp/pdqsortOfficial100%
Zlib

Pattern-defeating quicksort.

2,51498C++, PythonFeb 22, 20152 years agoZlib

Similar Papers

Cite this paper

@article{peters2021patterndefeating,
  title  = {Pattern-defeating Quicksort},
  author = {Orson R. L. Peters},
  year   = {2021},
  eprint = {2106.05123},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.05123}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.05123.svg)](https://codeofpaper.com/paper/2106.05123)

Discussion