Skip to main content

The Average Case Analysis of Partition Sorts

  • Conference paper
Algorithms – ESA 2004 (ESA 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3221))

Included in the following conference series:

  • 1470 Accesses

Abstract

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.

This work was supported in part by NSF grant CCR0105678.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Bentley, J.L.: Programming Pearls, 2nd edn. Addison-Wesley, Reading (2000)

    Google Scholar 

  2. Bentley, J.L., Douglas McIlroy, M.: Engineering a sort function. Software Practice and Experience 23(11), 1249–1265 (1993)

    Article  Google Scholar 

  3. Chen, J.-C.: Proportion split sort. Nordic Journal of Computing 3(3), 271–279 (Fall 1996)

    Google Scholar 

  4. Chen, J.-C.: Proportion extend sort. SIAM Journal on Computing 31(1), 323–330 (2002)

    Article  Google Scholar 

  5. Dutton, R.D.: Weak-heapsort. BIT 33(3), 372–381 (1993)

    Article  MathSciNet  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. 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 

  8. Ford Jr., L.R., Johnson, S.M.: A tournament problem. The American Mathematical Monthly 66(5), 387–389 (1959)

    Article  MATH  MathSciNet  Google Scholar 

  9. Floyd, R.W.: ACM Algorithm 245: Treesort 3. Communications of the ACM 7(12), 701 (1964)

    Article  Google Scholar 

  10. Hoare, C.A.R.: ACM Algorithm 63: Partition, ACM Algorithm 64: Quicksort. Communications of the ACM 4(7), 321–322 (1961)

    Article  Google Scholar 

  11. Hoare, C.A.R.: Quicksort. The Computer Journal 5(1), 10–16 (1962)

    Article  MATH  MathSciNet  Google Scholar 

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

    Google Scholar 

  13. Katajainen, J., Pasanen, T., Teuhola, J.: Practical in-place mergesort. Nordic Journal of Computing 3(1), 27–40 (Spring 1996)

    MathSciNet  Google Scholar 

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

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

    Article  Google Scholar 

  16. Reischuk, R.: Probabilistic parallel algorithms for sorting and selection. SIAM Journal on Computing 14(2), 396–409 (1985)

    Article  MATH  MathSciNet  Google Scholar 

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

  18. Sedgewick, R.: Implementing quicksort programs. Communications of the ACM 21(10), 847–857 (1978)

    Article  MATH  Google Scholar 

  19. Singleton, R.C.: An efficient algorithm for sorting with minimal storage. Communications of the ACM 12(3), 185–187 (1969)

    Article  Google Scholar 

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

  21. Williams, J.W.J.: ACM Algorithm 232: Heapsort. Communications of the ACM 7(6), 347–348 (1964)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cole, R., Kandathil, D.C. (2004). The Average Case Analysis of Partition Sorts. In: Albers, S., Radzik, T. (eds) Algorithms – ESA 2004. ESA 2004. Lecture Notes in Computer Science, vol 3221. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30140-0_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30140-0_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23025-0

  • Online ISBN: 978-3-540-30140-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics