Question: java problem: part a and b as reference: (a) Show the result of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7,
java problem:
part a and b as reference:
(a) Show the result of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, and 2, one at a time and in the giver order, into an initially empty binary min heap.
(b) Show the result of performing three deleteMin operations in the heap of the previous binary min heap.



(c) Write a method replaceKey in the MinHeap class with the following signature: public void replaceKey (Integer oldKey, Integer newKey) The method will replace the first occurrence of oldKey with the newKey, and restore the Min-Heap property after the change. If the oldKey does not exist in the heap, the method prints an appropriate message and returns without changing the heap. Example: Suppose our binary heap object (bh) has the following keys: 4 67 32 19 6426 99 42 54 28 Then the method call: bh.replaceKey (oldKey Integer(54), newKey Integer(2)) should change the keys to: 24 7 32 6 64 26 99 42 19 28 Note: You can assume that the methods perlocateUp and perlocateDown are already implemented in your MinHeap class (continue on next page) (d) What is the running time complexity of your replaceKey method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
