The objective of this experiment is to Convert the given Complete Binary Tree into a Max Heap.
In the previous experiment, we converted a Complete Binary Tree to a Max heap by processing one sub-tree at a time. In this experiment, you cannot select a node to mark it as root of the sub-tree to be processed. Last parent node of the tree is initially selected as the root. The process of selecting a root is controlled by two buttons:
On clicking "Decr" button, node which is just before the current root(previous node) is marked as root.
On clicking "Reset" button, Last Parent node is marked as root.
The processing of a sub-tree by clicking on "Heapify" button is same as in the previous experiment.
Root is highlighted in red color and subsequent child nodes in green color.