Question: Problem 4 Let T be a heap storing n keys. Assume for this problem that the heap is stored in an array A starting from

Problem 4 Let T be a heap storing n keys. Assume for this problem that the heap is stored in an array A starting from 1 that is, A] is the biggest key in the heap. Give an efficient algorithm for reporting all the keys in T that are greater than or equal to a given query key r (which is not necessarily in T). Note that the keys do not need to be reported (printed) in sorted order. Analyse the running time. An O(k) algorithm is needed for full grade, where k is the number of elements printed. That is, the algorithm should do a constant number of elementary operations per printed element
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
