Heap sort
Heap sort algorithm builds the max. heap using the elements to be sorted.
In max. heap, any sub-tree root node is bigger than its children node.
The algorithm swaps the root node (bigger element) with the last node (smaller element) and remove the last node which is the bigger element, then it re-creates the max. heap. The algorithm applies in the same manner on the sub-tree.
Resources
| https://www.youtube.com/watch?v=MtQL_ll5KhQ |