Heapsort
Classic in-place, O(n log n) sorting algorithm.
Uses the binary heap, an elegant priority queue data structure (insert and delete-max)
25
10
15
12
7
8
3
2
5
9
Perfectly balanced tree with
the heap property. Each node
is larger than its children.
Previous slide
Next slide
Back to first slide
View graphic version