The Average Case Analysis of Partition Sorts
This paper introduces a new family of in-place sorting algorithms, the partition sorts. They are appealing both for their relative simplicity and their efficient performance. They perform Θ(n log n) operations on the average, and \(\Theta(n \log^2\!n)\) operations in the worst case.
The partition sorts are related to another family of sorting algorithms discovered recently by Chen [Che02]. He showed empirically that one version ran faster, on the average, than quicksort, and that the algorithm family performed Θ(n log n) comparisons in the worst case; however no average case analysis was obtained.
This paper completes the analysis of Chen’s algorithm family. In particular, a bound of n log n +O(n) comparisons and Θ(n log n) operations is shown for the average case, and \(\Theta (n \log^2\!n)\) operations for the worst case. The average case analysis is somewhat unusual. It proceeds by showing that Chen’s sorts perform, on the average, no more comparisons than the partition sorts.
Optimised versions of the partition sort and Chen’s algorithm are very similar in performance, and both run marginally faster than an optimised quasi-best-of-nine variant of quicksort [BM93]. They both have a markedly smaller variance than the quicksorts.
KeywordsRecursive Call Additional Space Operation Count Input Ordering Cache Behaviour
Unable to display preview. Download preview PDF.
- [Ben00]Bentley, J.L.: Programming Pearls, 2nd edn. Addison-Wesley, Reading (2000)Google Scholar
- [Che96]Chen, J.-C.: Proportion split sort. Nordic Journal of Computing 3(3), 271–279 (Fall 1996)Google Scholar
- [FG03]Franceschini, G., Geffert, V.: An in-place sorting with O(n log n) comparisons and O(n) moves. In: Proceedings of the 44th Annual IEEE Symposium on Foundations of Computer Science (FOCS), Cambridge, Massachusetts, October 11-14, pp. 242–250 (2003)Google Scholar
- [Knu73]Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3. Addison-Wesley, Reading (1973)Google Scholar
- [LL97]LaMarca, A., Ladner, R.E.: The influence of caches on the performance of sorting. In: Proceedings of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, New Orleans, Louisiana, January 5-7, pp. 370–379 (1997)Google Scholar
- [Rei92]Reinhardt, K.: 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: Ibaraki, T., Iwama, K., Yamashita, M., Inagaki, Y., Nishizeki, T. (eds.) ISAAC 1992. LNCS, vol. 650, pp. 489–498. Springer, Heidelberg (1992)Google Scholar
- [Wil64]Williams, J.W.J.: ACM Algorithm 232: Heapsort. Communications of the ACM 7(6), 347–348 (1964)Google Scholar