CPSC 327 | Data Structures and Algorithms | Spring 2024 |
Insert 6, 30, 12 into the following max heap, showing the heap after each insertion.
Apply three remove-max operations to the following max heap, showing the heap after each deletion.
ADM 4-19, page 142. As part of your answer, explain how each operation would be carried out in a max heap and in a sorted array. For (b), consider both if you know where the element to be deleted is (you know what slot it is in) and if you don't and have to find it.