Using diagrams like those in this section, trace the action of heap sort on the lists in Exercises 4-7.
Exercise 4
Show the heap that results when the items are inserted into the heap, starting with one that is empty.
7,1,6,5,4,2,3
Exercise 5,
Show the heap that results when the items are inserted into the heap, starting with one that is empty.
1,7,2,6,3,5,4
Exercise 6,
Show the heap that results when the items are inserted into the heap, starting with one that is empty.
7,6,5,4,3,2,1
Exercise 7,
Show the heap that results when the items are inserted into the heap, starting with one that is empty.
1,2,3,4,5,6,7