Skip to main content Accessibility help
×
Home
Hostname: page-component-559fc8cf4f-67gxp Total loading time: 0.259 Render date: 2021-03-05T03:58:16.704Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Dual-Pivot Quicksort: Optimality, Analysis and Zeros of Associated Lattice Paths

Published online by Cambridge University Press:  14 August 2018

MARTIN AUMÜLLER
Affiliation:
IT University of Copenhagen, Rued Langgaards Vej 7, 2300 Copenhagen, Denmark (e-mail: maau@itu.dk)
MARTIN DIETZFELBINGER
Affiliation:
Fakultät für Informatik und Automatisierung, Technische Universität Ilmenau, Helmholtzplatz 5, 98693 Ilmenau, Germany (e-mail: martin.dietzfelbinger@tu-ilmenau.de)
CLEMENS HEUBERGER
Affiliation:
Institut für Mathematik, Alpen-Adria-Universität Klagenfurt, Universitätsstraße 65–67, 9020 Klagenfurt am Wörthersee, Austria (e-mail: clemens.heuberger@aau.at, math@danielkrenn.at, daniel.krenn@aau.at)
DANIEL KRENN
Affiliation:
Institut für Mathematik, Alpen-Adria-Universität Klagenfurt, Universitätsstraße 65–67, 9020 Klagenfurt am Wörthersee, Austria (e-mail: clemens.heuberger@aau.at, math@danielkrenn.at, daniel.krenn@aau.at)
HELMUT PRODINGER
Affiliation:
Department of Mathematical Sciences, Stellenbosch University, 7602 Stellenbosch, South Africa (e-mail: hproding@sun.ac.za)

Abstract

We present an average-case analysis of a variant of dual-pivot quicksort. We show that the algorithmic partitioning strategy used is optimal, that is, it minimizes the expected number of key comparisons. For the analysis, we calculate the expected number of comparisons exactly as well as asymptotically; in particular, we provide exact expressions for the linear, logarithmic and constant terms.

An essential step is the analysis of zeros of lattice paths in a certain probability model. Along the way a combinatorial identity is proved.

Type
Paper
Copyright
Copyright © Cambridge University Press 2018 

Access options

Get access to the full version of this content by using one of the access options below.

Footnotes

Supported by the Austrian Science Fund (FWF): P 24644-N26 and by the Karl Popper Kolleg ‘Modeling–Simulation–Optimization' funded by the Alpen-Adria-Universität Klagenfurt and by the Carinthian Economic Promotion Fund (KWF).

Supported by an incentive grant of the National Research Foundation of South Africa.

§

An extended abstract containing the ideas of the asymptotic analysis of the dual-pivot quicksort strategies ‘Count’ and ‘Clairvoyant’, as well as the lattice path analysis of this article appeared as [3], and an appendix containing proofs is available as arXiv:1602.04031v1. This article contains additionally a proof that ‘Count’ is indeed the optimal strategy. This led to a major restructuring; the analysis now focuses on this strategy. Moreover, some proofs have been simplified.

References

Ablinger, J. (2015) HarmonicSums V1.0, RISC. www.risc.jku.at/research/combinat/software/HarmonicSums/Google Scholar
Aumüller, M. and Dietzfelbinger, M. (2015) Optimal partitioning for dual-pivot quicksort. ACM Trans. Algorithms 12 18.CrossRefGoogle Scholar
Aumüller, M., Dietzfelbinger, M., Heuberger, C., Krenn, D. and Prodinger, H. (2016) Counting zeros in random walks on the integers and analysis of optimal dual-pivot quicksort. In Proceedings of the 27th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms.Google Scholar
Aumüller, M., Dietzfelbinger, M., Heuberger, C., Krenn, D. and Prodinger, H. (2016) Dual-pivot quicksort: Optimality, analysis and zeros of associated lattice paths. arxiv.org/abs/1611.00258Google Scholar
Aumüller, M., Dietzfelbinger, M. and Klaue, P. (2016) How good is multi-pivot quicksort? ACM Trans. Algorithms 13 8.CrossRefGoogle Scholar
Flajolet, P. and Sedgewick, R. (2009) Analytic Combinatorics, Cambridge University Press.CrossRefGoogle Scholar
Graham, R. L., Knuth, D. E. and Patashnik, O. (1994) Concrete Mathematics: A Foundation for Computer Science, second edition, Addison-Wesley.Google Scholar
Hackl, B. and Krenn, D. (2015) Asymptotic expansions in SageMath (module in SageMath 6.10 beta2). trac.sagemath.org/17601Google Scholar
Hennequin, P. (1991) Analyse en moyenne d'algorithmes : Tri rapide et arbres de recherche. PhD thesis, École Polytechnique, Palaiseau.Google Scholar
Hoare, C. A. R. (1962) Quicksort. Comput. J. 5 1015.CrossRefGoogle Scholar
Knuth, D. E. (1998) The Art of Computer Programming, Vol. 3: Sorting and Searching, second edition, Addison-Wesley.Google Scholar
Krattenthaler, C. (2015) Lattice path enumeration. In Handbook of Enumerative Combinatorics (Bóna, M., ed), Discrete Mathematics and its Applications series, CRC Press, pp. 589678.CrossRefGoogle Scholar
Mahmoud, H. (2008) Pólya Urn Models, first edition, CRC Press.CrossRefGoogle Scholar
Mohanty, S. G. (1979) Lattice Path Counting and Applications, Probability and Mathematical Statistics series, Academic Press.Google Scholar
Nebel, M. E., Wild, S. and Martínez, C. (2016) Analysis of pivot sampling in dual-pivot quicksort: A holistic analysis of Yaroslavskiy's partitioning scheme. Algorithmica 75 632683.CrossRefGoogle Scholar
OEIS (2017) The On-Line Encyclopedia of Integer Sequences. oeis.orgGoogle Scholar
SageMath (2016) SageMath Mathematics Software (Version 7.4). www.sagemath.orgGoogle Scholar
Schneider, C. (2007) Symbolic summation assists combinatorics. Sém. Lothar. Combin. 56 136.Google Scholar
Schneider, C. (2015) EvaluateMultiSums V0.96, RISC. Unpublished.Google Scholar
Schneider, C. (2015) Sigma V1.81, RISC. www.risc.jku.at/research/combinat/software/Sigma/Google Scholar
Sedgewick, R. (1975) Quicksort. PhD thesis, Stanford University.Google Scholar
Wild, S. (2013) Java 7's dual pivot quicksort. Master's thesis, Universität Kaiserslautern. https://kluedo.ub.uni-kl.de/files/3463/wild-master-thesis.pdfGoogle Scholar
Wild, S. (2016) Dual-pivot quicksort and beyond: Analysis of multiway partitioning and its practical potential. PhD thesis, Universität Kaiserslautern.Google Scholar
Wild, S., Nebel, M. E. and Neininger, R. (2015) Average case and distributional analysis of dual-pivot quicksort. ACM Trans. Algorithms 11 22.CrossRefGoogle Scholar
Yaroslavskiy, V. (2009) Replacement of quicksort in java.util.arrays with new dual-pivot quicksort (archived version of the discussion in the OpenJDK mailing list). mail.openjdk.java.net/pipermail/core-libs-dev/2009-September/002630.htmlGoogle Scholar

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 10
Total number of PDF views: 74 *
View data table for this chart

* Views captured on Cambridge Core between 14th August 2018 - 5th March 2021. This data will be updated every 24 hours.

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Dual-Pivot Quicksort: Optimality, Analysis and Zeros of Associated Lattice Paths
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Dual-Pivot Quicksort: Optimality, Analysis and Zeros of Associated Lattice Paths
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Dual-Pivot Quicksort: Optimality, Analysis and Zeros of Associated Lattice Paths
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *