 In the worst case, the new root has to be swapped with its child on each level until it reaches the bottom level of the heap, meaning that the delete operation has a time complexity relative to the height of the tree, or O(log "n").Building a heap from an array of input elements can be done by starting with an empty heap, then successively inserting each element.This approach, called Williams’ method after the inventor of binary heaps, is easily seen to run in time