The objective of this experiment is to Convert the given Complete Binary Tree into a Max Heap.
In this experiment, we convert a Complete Binary Tree into a Max Heap by processing one sub-tree at a time. We begin with sub-tree rooted at last parent node. While processing a sub-tree if we reach a leaf node or a correct node, we mark the node just before the current root as the new root node. We continue this entire process till no previous node exists. At the end, we have a Max-heap.
Root is highlighted in red color and subsequent child nodes in green color.