Unformatted text preview: Finally, for each of these (ﬁnal) trees, perform a ﬁnd with path compression on the deepest node, and show the resulting tree. 3. (10 pts) Suppose we start with n singleton nodes, and perform an arbitrary sequence of unions using the union by height rule—that is, always make the shallower tree the child. Then, give a proof (reasoning) that the worst-case depth of any tree is O (log n ). 4. (10 pts) Give a proof for the following assertion: if all of the unions precede all the ﬁnds, then the disjoint set algorithm with path compression requires O ( n ) time, even if unions are done arbitrarily....
View Full Document
- Winter '11
- Computational complexity theory, Disjoint sets, Disjoint-set data structure