ACM logo

The ACM Journal of Experimental Algorithmics


Volume 7, Article 5, 2002


Implementing HEAPSORT with (n logn - 0.9n) and QUICKSORT with (n logn + 0.2n) Comparisons

by

Stefan Edelkamp

and

Patrick Stiegeler

http://www.jea.acm.org/2002/EdelkampHeapsort/

Abstract:

With refinements to the weak-heap-sort algorithm we establish the general and practically relevant sequential sorting algorithm index-weak-heap-sort with exactly n ceiling(log n) - 2ceiling(log n) +1 <= n log n - 0.9 n comparisons and at most n log n + 0.1 n transpositions on any given input. It comprises an integer array of size n and is best used to generate an index for the data set. With relaxed-weak-heap-sort and greedy-weak-heap-sort we discuss modifications for a smaller set of pending element transpositions.

If extra space to create an index is not available, with quick-weak-heap-sort we propose an efficient quicksort variant with n log n + 0.2 n + o(n) comparisons on the average. Furthermore, we present data showing that weak-heap-sort, index-weak-heap-sort, and quick-weak-heap-sort compete with other performant quicksort and heapsort variants.

Received
Accepted
Final Revision
Published




Last updated and validated May 11, 2002, by editor@jea.acm.org