( ( figure adding the first two values to the heap heap at the end of the array all we have to do is keep track of where the heap ends and the sequence of remaining values begin if we consider the first value in the arrayit constitutes max-heap of one itemas shown in figure (awhen adding value to heapit' copied to the first element in the array immediately following the last heap item and sifted up the tree the next value from our sequence that is to be added to the heap is already in this position thusall we have to do is apply the sift-up operation to the valueresulting in max-heap with two itemsas illustrated in figure (bwe can repeat this process on each value in the array to create max-heap consisting of all the values from the array this process is illustrated in figure and includes both the abstract view of the heap and the contents figure adding the remaining values to the heap