Question
Question 2

Transcribed Image Text:2. Consider the following program operating on disjoint sets over the domain {x1, x2, ..., x16}:
1 to 16 do MAKESET(xi)
for
for
1 to 15 by 2 do WUNION(xi, Xi+1)
for i = 1 to 13 by 4 do WUNION (xi, Xi+2)
WUNION(X1, X5)
WUNION(X11, X13)
WUNION (X1, X10)
FINDSET(x2)
FINDSET(X9)
(a) Show the data structure that results after each step of the program (with the for loops
considered single steps). Use both the tree and the array representation of disjoint sets.
Assume (like we did in class) that if the sets containing x; and x; have the same size,
then the operation WUNION(xi, x;) adds the set x; to the children of x;.
(b) What is returned by the two calls to FINDSET? Explain.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- The Colombia City office of StayWell indicated that there is a new tenant by the name of Yigit Yilmaz staying at the property with an ID of 13. You need to include this new resident in the RESIDENTS table.arrow_forwardI want to know the syntax for sql alter column set default and drop defaultarrow_forwardWhat are the types of subquery?arrow_forward