Question: Question 4 : You are given a min - heap A [ 1 dotsn ] and a variable largest that stores the largest number in

Question 4: You are given a min-heap A[1dotsn] and a variable largest that stores the
largest number in this min-heap.
In class, we have seen algorithms InSERT(A,x)(which adds the number x to the min-
heap and restores the heap property) and ExTRACTMin(A)(which removes the smallest
number from the heap and restores the heap property).
Explain, in a few sentences, how these two algorithms can be modified such that the
value of largest is correctly maintained. The running times of the two modified algorithms
must still be O(logn).
 Question 4: You are given a min-heap A[1dotsn] and a variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!