## The Ultimate Heapsort (1998)

Venue: | In Proceedings of the Computing: the 4th Australasian Theory Symposium, Australian Computer Science Communications |

Citations: | 4 - 0 self |

### BibTeX

@TECHREPORT{Katajainen98theultimate,

author = {Jyrki Katajainen},

title = {The Ultimate Heapsort},

institution = {In Proceedings of the Computing: the 4th Australasian Theory Symposium, Australian Computer Science Communications},

year = {1998}

}

### Years of Citing Articles

### OpenURL

### Abstract

. A variant of Heapsort---named Ultimate Heapsort---is presented that sorts n elements in-place in \Theta(n log 2 (n+ 1)) worst-case time by performing at most n log 2 n + \Theta(n) key comparisons and n log 2 n + \Theta(n) element moves. The secret behind Ultimate Heapsort is that it occasionally transforms the heap it operates with to a two-layer heap which keeps small elements at the leaves. Basically, Ultimate Heapsort is like Bottom-Up Heapsort but, due to the two-layer heap property, an element taken from a leaf has to be moved towards the root only O(1) levels, on an average. Let a[1::n] be an array of n elements each consisting of a key and some information associated with this key. This array is a (maximum) heap if, for all i 2 f2; : : : ; ng, the key of element a[bi=2c] is larger than or equal to that of element a[i]. That is, a heap is a pointer-free representation of a left complete binary tree, where the elements stored are partially ordered according to their keys. Ele...