Heapsort: Heap Properties
The largest value is in the root
Any subtree of a heap is itself a heap
A heap can be stored in an array by indexing the vertices thus:
The left child of vertexv has index 2v andthe right child hasindex 2v+1
1
2
3
4
5
6
7
9
8
Previous slide
Next slide
Back to first slide
View graphic version