Advertisement

On the Performance of WEAK-HEAPSORT

  • Stefan Edelkamp
  • Ingo Wegener
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1770)

Abstract

Dutton (1993) presents a further HEAPSORT variant called WEAK-HEAPSORT, which also contains a new data structure for priority queues. The sorting algorithm and the underlying data structure are analyzed showing that WEAK-HEAPSORT is the best HEAPSORT variant and that it has a lot of nice properties.

It is shown that the worst case number of comparisons is n⌈log n⌉ — 2⌈log n + n − ⌈log n⌉ ≤ n log n + 0.1n and weak heaps can be generated with n − 1 comparisons. A double-ended priority queue based on weakheaps can be generated in n + ⌈n/2⌉ − 2 comparisons.

Moreover, examples for the worst and the best case of WEAK-HEAP-SORT are presented, the number of Weak-Heaps on 1, ... , n is determined, and experiments on the average case are reported.

Keywords

Average Case Priority Queue Sorting Algorithm Kolmogorov Complexity Extra Space 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    R. D. Dutton. The weak-heap data structure. Technical report, University of Central Florida, Orlando, FL 32816, 1992.Google Scholar
  2. [2]
    R. D. Dutton. Weak-heap sort. BIT, 33:372–381, 1993.CrossRefMathSciNetGoogle Scholar
  3. [3]
    S. Edelkamp and I. Wegener. On the performance of WEAK-HEAPSORT. Technical Report TR99-028, Electronic Colloquium on Computational Complexity, 1999. ISSN 1433-8092, 6th Year.Google Scholar
  4. [4]
    R. Fleischer. A tight lower bound for the worst case of Bottom-Up-Heapsort. Algorithmica, 11(2):104–115, 1994.CrossRefMathSciNetGoogle Scholar
  5. [5]
    R. W. Floyd. ACM algorithm 245: Treesort 3. Communications of the ACM, 7(12):701, 1964.CrossRefGoogle Scholar
  6. [6]
    T. N. Hibbard. A empirical study of minimal storage sorting. Communications of the ACM, 6(5):206–213, 1963.zbMATHCrossRefGoogle Scholar
  7. [7]
    C. A. R. Hoare. Quicksort. Computer Journal, 5(1):10–15, 1962.zbMATHCrossRefMathSciNetGoogle Scholar
  8. [8]
    J. Incerpi and R. Sedgewick. Improved upper bounds on shellsort. Journal of Computer and System Sciences, 31:210–224, 1985.zbMATHCrossRefMathSciNetGoogle Scholar
  9. [9]
    T. Jiang, M. Li, and P. Vitányi. Average complexity of shellsort. In ICALP’99, volume 1644 of LNCS, pages 453–462, 1999.Google Scholar
  10. [10]
    J. Katajainen. The ultimate heapsort. In Proceedings of the Computing: the 4th Australasian Theory Symposium, Australian Computer Science Communications 20(3), pages 87–95, 1998.MathSciNetGoogle Scholar
  11. [11]
    J. Katajainen, T. Pasanen, and J. Teuhola. Practical in-place mergesort. Nordic Journal of Computing, 3(1):27–40, 1996.MathSciNetGoogle Scholar
  12. [12]
    J. Katajainen and T. A. Pasanen. In-place sorting with fewer moves. Information Processing Letters, 70(1):31–37, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  13. [13]
    M. Li and P. Vitányi. An Introduction to Kolmogorov Complexity and Its Applications. Text and Monographs in Computer Science. Springer-Verlag, 1993.Google Scholar
  14. [14]
    C. J. H. McDiarmid and B. A. Reed. Building heaps fast. Journal of Algorithms, 10:352–365, 1989.zbMATHCrossRefMathSciNetGoogle Scholar
  15. [15]
    S. Nilsson. Radix Sorting & Searching. PhD thesis, Lund University, 1996.Google Scholar
  16. [16]
    A. Papernov and G. Stasevich. The worst case in shellsort and related algorithms. Problems Inform. Transmission, 1(3):63–75, 1965.Google Scholar
  17. [17]
    V. Pratt. Shellsort and Sorting Networks. PhD thesis, Stanford University, 1979.Google Scholar
  18. [18]
    K. Reinhardt. 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. Lecture Notes in Computer Science, 650:489–499, 1992.Google Scholar
  19. [19]
    W. Rudin. Real and Complex Analysis. McGraw-Hill, 1974.Google Scholar
  20. [20]
    R. Schaffer and R. Sedgewick. The analysis of heapsort. Journal of Algorithms, 15(1):76–100, 1993.zbMATHCrossRefMathSciNetGoogle Scholar
  21. [21]
    R. Sedgewick. The analysis of quicksort programs. Acta Inform., 7:327–355, 1977.zbMATHCrossRefMathSciNetGoogle Scholar
  22. [22]
    R. Sedgewick. A new upper bound for shellsort. Journal of Algorithms, 2:159–173, 1986.CrossRefMathSciNetGoogle Scholar
  23. [23]
    D. Shell. A high-speed sorting procedure. Communications of the ACM, 2(7):30–32, 1959.CrossRefGoogle Scholar
  24. [24]
    H. Steinhaus. One hundred problems in elemantary mathematics (Problems 52,85). Pergamon Press, London, 1958.Google Scholar
  25. [25]
    M. H. van Emden. Increasing the efficiency of QUICKSORT. Communications of the ACM, 13:563–567, 1970.zbMATHCrossRefGoogle Scholar
  26. [26]
    I. Wegener. The worst case complexity of McDiarmid and Reed’s variant of BOTTOM-UP HEAPSORT is less than n log n+1.1n. Information and Computation, 97(1):86–96, 1992.zbMATHCrossRefMathSciNetGoogle Scholar
  27. [27]
    I. Wegener. BOTTOM-UP-HEAPSORT, a new variant of HEAPSORT, beating, on an average, QUICKSORT (if n is not very small). Theoretical Computer Science, 118:81–98, 1993.zbMATHCrossRefMathSciNetGoogle Scholar
  28. [28]
    J. W. J. Williams. ACM algorithm 232: Heapsort. Communications of the ACM, 7(6):347–348, 1964.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Stefan Edelkamp
    • 1
  • Ingo Wegener
    • 2
  1. 1.Institut für InformatikAlbert-Ludwigs-UniversitätFreiburg
  2. 2.Lehrstuhl 2, Fachbereich InformatikUniversität DortmundDortmund

Personalised recommendations