Published online by Cambridge University Press: 14 August 2018
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.
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.