CPSC 327 Data Structures and Algorithms Spring 2024

Homework 9
due Fri 2/16 in class

  1. Insert 6, 30, 12 into the following max heap, showing the heap after each insertion.

  2. Apply three remove-max operations to the following max heap, showing the heap after each deletion.

  3. 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.