Average Cost of QuickXsort with Pivot Sampling

Author Sebastian Wild

Thumbnail PDF


  • Filesize: 0.63 MB
  • 19 pages

Document Identifiers

Author Details

Sebastian Wild
  • University of Waterloo, Canada

Cite AsGet BibTex

Sebastian Wild. Average Cost of QuickXsort with Pivot Sampling. In 29th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (AofA 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 110, pp. 36:1-36:19, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


QuickXsort is a strategy to combine Quicksort with another sorting method X so that the result has essentially the same comparison cost as X in isolation, but sorts in place even when X requires a linear-size buffer. We solve the recurrence for QuickXsort precisely up to the linear term including the optimization to choose pivots from a sample of k elements. This allows to immediately obtain overall average costs using only the average costs of sorting method X (as if run in isolation). We thereby extend and greatly simplify the analysis of QuickHeapsort and QuickMergesort with practically efficient pivot selection, and give the first tight upper bounds including the linear term for such methods.

Subject Classification

ACM Subject Classification
  • Theory of computation → Sorting and searching
  • in-situ sorting
  • constant-factor optimal sorting
  • pivot sampling
  • QuickMergesort
  • QuickHeapsort
  • Quicksort recurrence
  • average-case analysis


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. D. Cantone and G. Cincotti. Quickheapsort, an efficient mix of classical sorting algorithms. Theoretical Computer Science, 285(1):25-42, 2002. URL: http://dx.doi.org/10.1016/S0304-3975(01)00288-2.
  2. Domenico Cantone and Gianluca Cincotti. QuickHeapsort, an efficient mix of classical sorting algorithms. In Italian Conference on Algorithms and Complexity (CIAC), pages 150-162, 2000. URL: http://dx.doi.org/10.1007/3-540-46521-9_13.
  3. Volker Diekert and Armin Weiß. QuickHeapsort: Modifications and improved analysis. Theory of Computing Systems, 59(2):209-230, aug 2016. URL: http://dx.doi.org/10.1007/s00224-015-9656-y.
  4. Ernst E. Doberkat. An average case analysis of Floyd’s algorithm to construct heaps. Information and Control, 61(2):114-131, may 1984. URL: http://dx.doi.org/10.1016/S0019-9958(84)80053-4.
  5. Stefan Edelkamp and Armin Weiß. QuickXsort: Efficient sorting with n log n - 1.399 n + o(n) comparisons on average. In International Computer Science Symposium in Russia, pages 139-152. Springer, 2014. URL: http://dx.doi.org/10.1007/978-3-319-06686-8_11.
  6. Stefan Edelkamp and Armin Weiß. QuickMergesort: Practically efficient constant-factor optimal sorting, 2018. URL: http://arxiv.org/abs/1804.10062.
  7. Philippe Flajolet and Mordecai Golin. Mellin transforms and asymptotics. Acta Informatica, 31(7):673-696, 1994. URL: http://dx.doi.org/10.1007/BF01177551.
  8. Lester R. Ford and Selmer M. Johnson. A tournament problem. The American Mathematical Monthly, 66(5):387, may 1959. URL: http://dx.doi.org/10.2307/2308750.
  9. Viliam Geffert and Jozef Gajdoš. In-place sorting. In SOFSEM 2011: Theory and Practice of Computer Science, pages 248-259. Springer, 2011. URL: http://dx.doi.org/10.1007/978-3-642-18381-2_21.
  10. Hsien-Kuei Hwang. Limit theorems for mergesort. Random Structures and Algorithms, 8(4):319-336, jul 1996. URL: http://dx.doi.org/10.1002/(sici)1098-2418(199607)8:4<319::aid-rsa3>3.0.co;2-0.
  11. Hsien-Kuei Hwang. Asymptotic expansions of the mergesort recurrences. Acta Informatica, 35(11):911-919, 1998. URL: http://dx.doi.org/10.1007/s002360050147.
  12. Jyrki Katajainen. The ultimate heapsort. In Proceedings of the Computing: The 4th Australasian Theory Symposium, Australian Computer Science Communications, pages 87-96. Springer-Verlag Singapore Pte. Ltd., 1998. URL: http://www.diku.dk/~jyrki/Myris/Kat1998C.html.
  13. Jyrki Katajainen, Tomi Pasanen, and Jukka Teuhola. Practical in-place mergesort. Nordic Journal of Computing, 3(1):27-40, 1996. URL: http://www.diku.dk/~jyrki/Myris/KPT1996J.html.
  14. Donald E. Knuth. The Art Of Computer Programming: Searching and Sorting. Addison Wesley, 2nd edition, 1998. Google Scholar
  15. Heikki Mannila and Esko Ukkonen. A simple linear-time algorithm for in situ merging. Information Processing Letters, 18(4):203-208, 1984. URL: http://dx.doi.org/10.1016/0020-0190(84)90112-1.
  16. Conrado Martínez and Salvador Roura. Optimal sampling strategies in Quicksort and Quickselect. SIAM Journal on Computing, 31(3):683-705, 2001. URL: http://dx.doi.org/10.1137/S0097539700382108.
  17. Wolfgang Panny and Helmut Prodinger. Bottom-up mergesort - a detailed analysis. Algorithmica, 14(4):340-354, 1995. URL: http://dx.doi.org/10.1007/BF01294131.
  18. Klaus Reinhardt. Sorting in-place with a worst case complexity of n log n - 1.3n+O(log n) comparisons and ε n log n+O(1) transports. In International Symposium on Algorithms and Computation (ISAAC), pages 489-498, 1992. URL: http://dx.doi.org/10.1007/3-540-56279-6_101.
  19. Salvador Roura. Divide-and-Conquer Algorithms and Data Structures. Tesi doctoral (Ph. D. thesis, Universitat Politècnica de Catalunya, 1997. Google Scholar
  20. Salvador Roura. Improved master theorems for divide-and-conquer recurrences. Journal of the ACM, 48(2):170-205, 2001. URL: http://dx.doi.org/10.1145/375827.375837.
  21. Robert Sedgewick and Philippe Flajolet. An Introduction to the Analysis of Algorithms. Addison-Wesley-Longman, 2nd edition, 2013. Google Scholar
  22. Robert Sedgewick and Kevin Wayne. Algorithms. Addison-Wesley, 4th edition, 2011. Google Scholar
  23. Sebastian Wild. Dual-Pivot Quicksort and Beyond: Analysis of Multiway Partitioning and Its Practical Potential. Doktorarbeit (phd-thesis), Technische Universität Kaiserslautern, 2016. ISBN 978-3-00-054669-3. URL: http://nbn-resolving.de/urn/resolver.pl?urn:nbn:de:hbz:386-kluedo-44682.
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail