Question: Suppose that we define a ExtractMin-Insert-Stable (EIS) heap as a min heap with no duplicate elements where the result of calling ExtractMin and immediately re-inserting
Suppose that we define a ExtractMin-Insert-Stable (EIS) heap as a min heap with no duplicate elements where the result of calling ExtractMin and immediately re-inserting that same element is the original heap.
(a) Provide an example of an EIS min heap with seven elements. Display both the original heap (which is the final heap) and the intermediate heap (after the call to ExtractMin) as trees.
(b) Provide an example of a min heap with seven distinct elements that is not an EIS heap. Display the original heap, the intermediate heap and the final heap all as trees.
(c) Formally describe the relationship between the elements that must hold for a heap to be an EIS min heap.
(d) Prove that your description in part (c) describes all EIS min heaps and does not hold for min heaps that are not EIS.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
