heaps descending order we'll call these two parts of the algorithm phase and phase ii to implement phase we'll need one new method in our heap class the addtoheap method def addtoheap(self,newobject)'''if the heap is fulldouble its current capacity add the newobject to the heapmaintaining it as heap of the same type answer newobject ''this new method can use the __siftupfrom private method to get the new element to its final destination within the heap version of phase calls addtoheap times this results in ( log ncomplexity the specific steps of phase include double the capacity of the heap if necessary data[sizenewobject __siftupfrom(size size as you can see__siftupfrom will be called timesonce for each element of the heap each time __siftupfrom is calledthe heap will have grown by element consider the heap in fig just before pass # we are about to sift the up to its rightful location within the heap conceptually we have the picture of the heap shown in fig to move the to the correct location we must compute the parent index from the child indices as shown in table fig adding to the heap fig conceptual view while adding to the heap this copy belongs to 'acha