Question
We define a Delete-Insert-Stable (DIS) heap as a heap with no duplicate elements where the result of extracting the root element and immediately re-inserting that
We define a Delete-Insert-Stable (DIS) heap as a heap with no duplicate elements where the result of extracting the root element and immediately re-inserting that element is the original heap.
-
Provide an example of a DIS max heap with seven elements. Display both the original heap (which is of course also the final heap) and the intermediate heap (after the call to ExtractMax) as trees.
-
Provide an example of a max heap with seven distinct elements that is not a DIS heap. Display the original heap, the intermediate heap and the final heap all as trees.
-
Formally describe the relationship between the elements that must hold for a heap to be a DIS max heap.
-
Prove that your description in part (c) describes all DIS max heaps and does not hold for max heaps that are not DIS.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started