Skip to main content

Optimal Partitioning for Dual Pivot Quicksort

(Extended Abstract)

  • Conference paper
Automata, Languages, and Programming (ICALP 2013)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7965))

Included in the following conference series:

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].

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aumüller, M., Dietzfelbinger, M.: Optimal partitioning for dual pivot quicksort. CoRR abs/1303.5217 (2013)

    Google Scholar 

  2. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press (2009)

    Google Scholar 

  3. Hennequin, P.: Analyse en moyenne d’algorithmes: tri rapide et arbres de recherche. Ph.D. thesis, Ecole Politechnique, Palaiseau (1991)

    Google Scholar 

  4. Hoare, C.A.R.: Quicksort. Comput. J. 5(1), 10–15 (1962)

    Article  MathSciNet  MATH  Google Scholar 

  5. Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. III. Addison-Wesley (1973)

    Google Scholar 

  6. Sedgewick, R.: Quicksort. Ph.D. thesis, Standford University (1975)

    Google Scholar 

  7. Sedgewick, R.: Quicksort with equal keys. SIAM J. Comput. 6(2), 240–268 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  8. Sedgewick, R.: Implementing quicksort programs. Commun. ACM 21(10), 847–857 (1978)

    Article  MATH  Google Scholar 

  9. Sedgewick, R., Flajolet, P.: An introduction to the analysis of algorithms. Addison-Wesley-Longman (1996)

    Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics