is smaller and the two values have to be swappedas shown in part (dthe comparison is repeated againbut this time we find value is less than or equal to its parent and the process ends nowsuppose we add value to the heapas illustrated in figure the new node is created and filled with value and linked into the tree as the left child of node when the new value is sifted upwe find values and have to be swappedresulting in the final placement of the new value ( (bfigure inserting value into the heap(acreate the new node and link it into the treeand (bsift the new value up the tree extractions when value is extracted and removed from the heapit can only come from the root node thusin max-heapwe always extract the largest value and in min-heapwe always extract the smallest value after the value in the root has been removedthe binary tree is no longer heap since there is now gap in the root nodeas illustrated in figure to restore the tree to heapanother value will have to take the place of the value extracted from the root and node has to be removed from the tree since figure extracting value from the max-heap leaves hole at the root node