enter first letter of showinsertremovechanger enter first letter of showinsertremovechanges heaparray enter first letter of showinsertremovechangethe user displays the heapadds an item with key of shows the heap againremoves the item with the greatest keyand shows the heap third time the show(routine displays both the array and the tree versions of the heap you'll need to use your imagination to fill in the connections between nodes expanding the heap array what happens ifwhile program is runningtoo many items are inserted for the size of the heap arraya new array can be createdand the data from the old array copied into it (unlike the situation with hash tableschanging the size of heap doesn' require reordering the data the copying operation takes linear timebut enlarging the array size shouldn' be necessary very oftenespecially if the array size is increased substantially each time it' expanded (by doubling itfor exampletip in javaa vector class object could be used instead of an arrayvectors can be expanded dynamically efficiency of heap operations for heap with substantial number of itemsthe trickle-up and trickle-down algorithms are the most time-consuming part of the operations we've seen these algorithms spend time in looprepeatedly moving nodes up or down along path the number of copies necessary is bounded by the height of the heapif there are five levelsfour copies will carry the "holefrom the top to the bottom (we'll ignore the two moves used to transfer the end node to and from temporary storagethey're always necessaryso they require constant time