Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 All Links before Finds Suppose that we use the disjoint - set union data structure for a sequence of m Make - Set, Find
All Links before Finds
Suppose that we use the disjointset union data structure for a sequence of MakeSet, FindSet and Link operations, but we are told that all of the Link operations are performed before any FindSet operation. As usual, assume that there are MakeSet operations. Furthermore, suppose that we implement the data structure using both UnionbyRank and Path Compression. Show that the total actual running time for all operations is
Note: Recall that the Link operation is given the two roots of the trees to be merged. Thus, you do not need to perform any FindSet operations to execute a Link. This is just an exercise. It would be unclear how an application using this data structure would know which items are roots.
Hint: Think about paying for the path compression during a FindSet.
Note: There is no limit on the number of FindSet operations. While we do know that is the total number of operations including FindSets you cannot assume a relationship between and the number of items I.e the number of FindSet operations could greatly exceed the number of items
Offline Minimum
Do Problem in CLRS Problem in the third edition except in part a use the following sequence of operations:
Note: The premise of this problem is that you can turn the extractmin question around when the problem is offline. Instead of asking
Which item will this call to ExtractMin return?
you ask
Which ExtractMin call will return this item?
For example, if the item in question is the smallest item then it will be returned by some call to ExtractMin unless is inserted after the last call to ExtractMin So the question is which call will return
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