Suppose you have an array A[1...n] of n elements in arbitrary order, the following alternate implementation of build max-heap.
This algorithm calls heapify starting at the root and working its way down the tree, instead of the other way around.
For the given input A[1,2,3,4] what will be the output ?