Draw a possible min-max heap for the items 1 2 3 4 5 6 7 8


Question: A min-max heap is a data structure that supports both delete Min and delete Max at logarithmic cost. The structure is identical to the binary heap. The min-max heap-order property is that for any node X at even depth, the key stored at X is the smallest in its subtree, whereas for any node X at odd depth, the key stored at X is the largest in its subtree. The root is at even depth. Do the following.

a. Draw a possible min-max heap for the items 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10. Note that there are many possible heaps.

b. Determine how to find the minimum and maximum elements.

c. Give an algorithm to insert a new node into the min-max heap.

d. Give an algorithm to perform delete Min and delete Max.

e. Give an algorithm to perform build Heap in linear time

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Draw a possible min-max heap for the items 1 2 3 4 5 6 7 8
Reference No:- TGS02462728

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)