Question: Suppose that we have implemented a priority queue by storing the items in a heap ( using an array for the heap items ) .

Suppose that we have implemented a priority queue by storing the items in a heap (using an array for the heap items). We are now executing a reheapification upward and the out-of-place node is at data[i] with priority given by data[i]. Which of the following boolean expressions is TRUE to indicate that the reheapification IS NOT YET DONE.
A.(i >0)
B.(data[(i-1)/2]< data[i])
C.(i >0) && (data[(i-1)/2]< data[i])
D.(i >0)||(data[(i-1)/2]< data[i])

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!