Definitions
from Wiktionary, Creative Commons Attribution/Share-Alike License.
- noun computing A
sorting algorithm based on theheap data structure . - verb transitive (
computing ) To sort with such an algorithm.
Etymologies
from Wiktionary, Creative Commons Attribution/Share-Alike License
Support
Help support Wordnik (and make this page ad-free) by adopting the word heapsort.
Examples
-
8.4 Heapsort In this section we develop a sorting algorithm called heapsort whose worst case as well as average case running time is O (nlogn).
-
There are other methods, such as heapsort and mergesort, that take O (nlogn) time in the worst case, although their average case behavior may not be quite as good as that of quicksort.
-
You can test it with: java. exe com. mindprod.heapsort.
-
First, here's a taster - a static visualisation of heapsort:
Deeplinking 2009
-
First, here's a taster - a static visualisation of heapsort:
apps 2009
-
It doesn't matter if the element space is limited: heapsort is still
-
It doesn't matter if the element space is limited: heapsort is still O (n log n), merge sort is still O (n log n).
-
In the diagram the "rabbits" are the dark lines sweeping down to their positions rapidly, and the turtles are the lighter lines that gradually curve towards the top right of the image. heapsort image at the top of this article.
Deeplinking 2009
-
Thus, heapsort, modified to produce only the first k elements takes O (n + k log n) time.
-
Sort them using (a) quicksort, (b) insertion sort, (c) heapsort, and (d) bin sort, treating them as pairs of digits in the range 0-9.
Comments
Log in or sign up to get involved in the conversation. It's quick and easy.