Question: : 4 . Assume there is a max - heap of size 3 1 whose values are distinct. The largest item in the max -

: 4. Assume there is a max-heap of size 31 whose values are distinct. The largest item in the max-heap must appear at index 1, and the second largest item...
4. Assume there is a max-heap of size 31 whose values are distinct. The largest item in the max-heap must appear at index 1, and the second largest item must be at index 2 or index 3.
(1 point) Give the list of indices in the max-heap of size 31 where the k-th largest item (i) can appear, and (ii) cannot appear, for k=2,3,4.(assuming the item values to be distinct)
(1 point) Give the list of indices in the max-heap of size 31 where the k-th smallest item (i) can appear, and (ii) cannot appear, for k=2,3,4.(assuming the item values to be distinct)
 : 4. Assume there is a max-heap of size 31 whose

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!