applying this to our integral we have the following ln and dv dx du dx and    ln dx ln dx  ln    dx ln - ln ( we have proved that the lower bound is proportional to log similarlywe could prove that the upper bound is also proportional to log therefore the work done by inserting elements into heap using the __siftupfrom method is th ( log nwe can do betterif the values in the heap were in the correct order we could achieve (ncomplexity using different approach we will be able to achieve (ncomplexity in all cases phase ii laterwe will investigate how to improve the performance of phase recall that phase of the heapsort algorithm builds heap from list of values phase ii takes the elements out of the heapone at timeand places them in list to save spacethe same list that was used for the heap may be used for the list of values to be returned each pass of phase ii takes one item from the list and places it where it belongs and the size of the heap is decremented by one the key operation is the __siftdownfromto method (fig the siftdownfromto method def __siftdownfromto(selffromindexlastindex)'''fromindex is the index of an element in the heap predata[fromindex lastindexsatisfies the heap conditionexcept perhaps for the element data[fromindexpostthat element is sifted down as far as neccessary to maintain the heap structure for data[fromindex lastindex''to illustrate this methodlet' take our small heap example and start extracting the values from it consider the heap in fig where both the conceptual view and the organization of that heap are shown is at the top of the heap and is also the largest value this copy belongs to 'acha