Skip to main content

QuickXsort: Efficient Sorting with n logn − 1.399n + o(n) Comparisons on Average

  • Conference paper
Computer Science - Theory and Applications (CSR 2014)

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

Included in the following conference series:

Abstract

In this paper we generalize the idea of QuickHeapsort leading to the notion of QuickXsort. Given some external sorting algorithm X, QuickXsort yields an internal sorting algorithm if X satisfies certain natural conditions. We show that up to o(n) terms the average number of comparisons incurred by QuickXsort is equal to the average number of comparisons of X.

We also describe a new variant of WeakHeapsort. With QuickWeakHeapsort and QuickMergesort we present two examples for the QuickXsort construction. Both are efficient algorithms that perform approximately n logn − 1.26n + o(n) comparisons on average. Moreover, we show that this bound also holds for a slight modification which guarantees an \(n \log n + \mathcal{O}(n)\) bound for the worst case number of comparisons.

Finally, we describe an implementation of MergeInsertion and analyze its average case behavior. Taking MergeInsertion as a base case for QuickMergesort, we establish an efficient internal sorting algorithm calling for at most n logn − 1.3999n + o(n) comparisons on average. QuickMergesort with constant size base cases shows the best performance on practical inputs and is competitive to STL-Introsort.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

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.

Similar content being viewed by others

References

  1. Blum, M., Floyd, R.W., Pratt, V., Rivest, R.L., Tarjan, R.E.: Time bounds for selection. J. Comput. Syst. Sci. 7(4), 448–461 (1973)

    Article  MATH  MathSciNet  Google Scholar 

  2. Cantone, D., Cinotti, G.: QuickHeapsort, an efficient mix of classical sorting algorithms. Theoretical Computer Science 285(1), 25–42 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  3. Diekert, V., Weiß, A.: Quickheapsort: Modifications and improved analysis. In: Bulatov, A.A., Shur, A.M. (eds.) CSR 2013. LNCS, vol. 7913, pp. 24–35. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  4. Dutton, R.D.: Weak-heap sort. BIT 33(3), 372–381 (1993)

    Article  MathSciNet  Google Scholar 

  5. Edelkamp, S., Stiegeler, P.: Implementing HEAPSORT with n logn − 0.9n and QUICKSORT with n logn + 0.2 n comparisons. ACM Journal of Experimental Algorithmics 10(5) (2002)

    Google Scholar 

  6. Edelkamp, S., Wegener, I.: On the performance of WEAK − HEAPSORT. In: Reichel, H., Tison, S. (eds.) STACS 2000. LNCS, vol. 1770, pp. 254–266. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  7. Edelkamp, S., Weiß, A.: QuickXsort: Efficient Sorting with n logn − 1.399n + o(n) Comparisons on Average. ArXiv e-prints, abs/1307.3033 (2013)

    Google Scholar 

  8. Elmasry, A., Katajainen, J., Stenmark, M.: Branch mispredictions don’t affect mergesort. In: Klasing, R. (ed.) SEA 2012. LNCS, vol. 7276, pp. 160–171. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  9. Ford, J., Lester, R., Johnson, S.M.: A tournament problem. The American Mathematical Monthly 66(5), 387–389 (1959)

    Article  MATH  MathSciNet  Google Scholar 

  10. Katajainen, J.: The Ultimate Heapsort. In: CATS, pp. 87–96 (1998)

    Google Scholar 

  11. Katajainen, J., Pasanen, T., Teuhola, J.: Practical in-place mergesort. Nord. J. Comput. 3(1), 27–40 (1996)

    MathSciNet  Google Scholar 

  12. Knuth, D.E.: Sorting and Searching, 2nd edn. The Art of Computer Programming, vol. 3. Addison Wesley Longman (1998)

    Google Scholar 

  13. Martínez, C., Roura, S.: Optimal Sampling Strategies in Quicksort and Quickselect. SIAM J. Comput. 31(3), 683–705 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  14. Musser, D.R.: Introspective sorting and selection algorithms. Software—Practice and Experience 27(8), 983–993 (1997)

    Article  Google Scholar 

  15. Reinhardt, K.: Sorting in-place with a worst case complexity of n logn − 1.3 n + o(logn) comparisons and εn logn + o(1) transports. In: Ibaraki, T., Iwama, K., Yamashita, M., Inagaki, Y., Nishizeki, T. (eds.) ISAAC 1992. LNCS, vol. 650, pp. 489–498. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  16. Wegener, I.: Bottom-up-Heapsort, a new variant of Heapsort beating, on an average, Quicksort (if n is not very small). Theoretical Computer Science 118(1), 81–98 (1993)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Edelkamp, S., Weiß, A. (2014). QuickXsort: Efficient Sorting with n logn − 1.399n + o(n) Comparisons on Average. In: Hirsch, E.A., Kuznetsov, S.O., Pin, JÉ., Vereshchagin, N.K. (eds) Computer Science - Theory and Applications. CSR 2014. Lecture Notes in Computer Science, vol 8476. Springer, Cham. https://doi.org/10.1007/978-3-319-06686-8_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-06686-8_11

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-06685-1

  • Online ISBN: 978-3-319-06686-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics