Heap tree – Heap sort. Heap is another Tree Structure. Let H be the complete binary tree with n elements, then this H will be called as Heap,
if each node of N of H has the following property : 1. Value of parent node should be greater then the value of child
2. Level should be filled from left to right and
3. Unless a level is not completely filled we cannot switch to next level.
Here is an example to implement c program for heap sort. Heap sort complexity is another topic that is to be studied while studying data structure.
Heap tree – Heap sort
To know that how to insert, traverse and perform sorting on heap, see the following animation, which can be also founded at wiki:
Heap tree – Heap sort – Two types of Heap can be formed:
1. Max Heap: The value at Node N is greater than or equal to the value at each of the children of N or value of parent should be greater than that of child.
2. Min Heap: The value at Node N is less than or equal to the value of any of the children of N or value of parent should be less than that of child.
If you want to discuss more over heap tree then do comment below.