Optimal partitioning for dual pivot quicksort

  • Authors:
  • Martin Aumüller;Martin Dietzfelbinger

  • Affiliations:
  • Faculty of Computer Science and Automation, Ilmenau University of Technology, Ilmenau, Germany;Faculty of Computer Science and Automation, Ilmenau University of Technology, Ilmenau, Germany

  • Venue:
  • ICALP'13 Proceedings of the 40th international conference on Automata, Languages, and Programming - Volume Part I
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dual pivot quicksort refers to variants of classical quicksort where in the partitioning step two pivots are used to split the input into three segments. This can be done in different ways, giving rise to different algorithms. Recently, a dual pivot algorithm due to Yaroslavskiy received much attention, because it replaced the well-engineered quicksort algorithm in Oracle's Java 7 runtime library. Nebel and Wild (ESA 2012) analyzed this algorithm and showed that on average it uses 1.9nln n+O(n) comparisons to sort an input of size n, beating standard quicksort, which uses 2nln n+O(n) comparisons. We introduce a model that captures all dual pivot algorithms, give a unified analysis, and identify new dual pivot algorithms that minimize the average number of key comparisons among all possible algorithms up to lower order or linear terms. This minimum is 1.8n ln n+O(n).