Question
2. [Disjoint Sets] Consider the set of vertices A-P, and the relationships {(D, A), (B, E), (C, P), (I, J), (L, N), (O, D), (K,
2. [Disjoint Sets] Consider the set of vertices A-P, and the relationships {(D, A), (B, E), (C, P), (I, J), (L, N), (O, D), (K, L), (L, A), (F, M), (G, M), (H, P), (L, G), (E, K)}. Show the final forest if
2a) The tree for the right element is always pointed at the left element.
2b) The smaller tree is always pointed at the larger tree, pointing right at left if of equal rank.
2c) The smaller tree is always pointed at the larger tree, and path compression is used.
In each case, give the total number of pointers followed in searching and the number of pointers added or changed during the algorithm. Then, for each forest, give (1) the maximum depth of a node, (2) the cost of searching, averaged over the 16 nodes. [Remember that a search starts at the node and runs to the root. Do not use path compression on those searches.]
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