insert( times figure shows the order in which the trickle-down algorithm is appliedstarting at node in -node heap figure order of applying trickledown(the following code fragment applies trickledown(to all nodesexcept those on the bottom rowstarting at / - and working back to the rootfor( =size/ - >= --theheap trickledown( ) recursive approach recursive approach can also be used to form heap from an array heapify(method is applied to the root it calls itself for the root' two childrenthen for each of these children' two childrenand so on eventuallyit works its way down to the bottom rowwhere it returns immediately whenever it finds node with no children after it has called itself for two child subtreesheapify(then applies trickledown(to the root of the subtree this ensures that the subtree is correct heap then heapify(returns and works on the subtree one level higher heapify(int indexif(index / - returnheapify(index* + )heapify(index* + )trickledown(index)/transform array into heap /if node has no children/return /turn right subtree into heap /turn left subtree into heap /apply trickle-down to this node this recursive approach is probably not quite as efficient as the simple loop