Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 Frequent Consolidation In Fibonacci Heaps, the consolidate procedure is called only during ExtractMin ( ) . That makes the data structure rather messy. In
Frequent Consolidation
In Fibonacci Heaps, the consolidate procedure is called only during ExtractMin That makes the data structure rather "messy". In this problem, we explore some ways that might make Fibonacci Heaps tidier. Throughout, we will keep the same invariant as before: $ credit on each root in the root list and $ on each marked node.
Recall that in the standard implementation of Fibonacci Heaps, when we insert an item we just make its own heap with a single item and add that heap to the root list.
Suppose that we modify the Insert operation and have it call the consolidate procedure after each new item is added to the root list. Explain why we cannot maintain the invariant and still have Insert run in amortized time.
The astute observer would correctly claim that the previous question is silly because if we consolidate after every insertion, then the roots in the root list would always have unique degree. If we keep the roots sorted by degree in the root list starting with degree then we can easily combine the newly inserted with the heaps already in the root list. The process will be very similar to the ripplecarry adder in the binary counter example for amortized analysis.
For example, if the root list has roots with degree and then we fist merge the new heap which has degree with the degree root. This makes a root with degree which we merge with the existing root with degree That makes a root with degree which gets merged and forms a root with degree After that we stop merging and the resulting root list has roots with degree and We can just use the $ stored at each root to pay for the merges, add $ to the new root and Insert would still run in amortized time.
Explain what happens to the amortized running times of ExtractMin, DecreaseKey and Merge operations under such a scheme.
Another variation of the previous scheme is to keep an array Root indexed by degree so that Root i points to the unique heap where the root has degree if one exists That is we keep an array of roots instead of a list of roots. Does the binary counter scheme still work to keep Insertion at amortized running time? Explain.
Explain what happens to the amortized running times of ExtractMin, DecreaseKey and Merge operations under our new scheme.
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