fig building heap part two fig building heap part three right place parentindex ( )// we compare with the and swap the two elements this is the last iteration of sifting up because has now reached the root ( index of the heap after swapping the two values we get the heap in fig the heapsort algorithm version heaps have two basic operations you can add value to heap you can also deleteand retrievethe maximum value from heap if the heap is largest on top heap using these two operationsor variations of themwe can devise sorting algorithm by building heap with list of values and then removing the values one by one in this copy belongs to 'acha