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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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)
Cantone, D., Cinotti, G.: QuickHeapsort, an efficient mix of classical sorting algorithms. Theoretical Computer Science 285(1), 25–42 (2002)
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)
Dutton, R.D.: Weak-heap sort. BIT 33(3), 372–381 (1993)
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)
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)
Edelkamp, S., Weiß, A.: QuickXsort: Efficient Sorting with n logn − 1.399n + o(n) Comparisons on Average. ArXiv e-prints, abs/1307.3033 (2013)
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)
Ford, J., Lester, R., Johnson, S.M.: A tournament problem. The American Mathematical Monthly 66(5), 387–389 (1959)
Katajainen, J.: The Ultimate Heapsort. In: CATS, pp. 87–96 (1998)
Katajainen, J., Pasanen, T., Teuhola, J.: Practical in-place mergesort. Nord. J. Comput. 3(1), 27–40 (1996)
Knuth, D.E.: Sorting and Searching, 2nd edn. The Art of Computer Programming, vol. 3. Addison Wesley Longman (1998)
Martínez, C., Roura, S.: Optimal Sampling Strategies in Quicksort and Quickselect. SIAM J. Comput. 31(3), 683–705 (2001)
Musser, D.R.: Introspective sorting and selection algorithms. Software—Practice and Experience 27(8), 983–993 (1997)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)