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).
For a full version containing all proofs, a discussion of swap strategies, more experiments, and pseudocode of the algorithms, see [1].
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aumüller, M., Dietzfelbinger, M.: Optimal partitioning for dual pivot quicksort. CoRR abs/1303.5217 (2013)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press (2009)
Hennequin, P.: Analyse en moyenne d’algorithmes: tri rapide et arbres de recherche. Ph.D. thesis, Ecole Politechnique, Palaiseau (1991)
Hoare, C.A.R.: Quicksort. Comput. J. 5(1), 10–15 (1962)
Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. III. Addison-Wesley (1973)
Sedgewick, R.: Quicksort. Ph.D. thesis, Standford University (1975)
Sedgewick, R.: Quicksort with equal keys. SIAM J. Comput. 6(2), 240–268 (1977)
Sedgewick, R.: Implementing quicksort programs. Commun. ACM 21(10), 847–857 (1978)
Sedgewick, R., Flajolet, P.: An introduction to the analysis of algorithms. Addison-Wesley-Longman (1996)
Wild, S., Nebel, M.E.: Average case analysis of Java 7’s dual pivot quicksort. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp. 825–836. Springer, Heidelberg (2012)
Wild, S., Nebel, M.E., Reitzig, R., Laube, U.: Engineering Java 7’s dual pivot quicksort using MaLiJan. In: ALENEX 2013, pp. 55–69 (2013)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Aumüller, M., Dietzfelbinger, M. (2013). Optimal Partitioning for Dual Pivot Quicksort. In: Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds) Automata, Languages, and Programming. ICALP 2013. Lecture Notes in Computer Science, vol 7965. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39206-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-39206-1_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-39205-4
Online ISBN: 978-3-642-39206-1
eBook Packages: Computer ScienceComputer Science (R0)