Question: Problem 3 In this problem, we consider the disjoint set forests. Instead of union by rank and path compression, we use union by number: The

Problem 3 In this problem, we consider the disjoint set forests. Instead of union by rank and path compression, we use union by number: The root of each tree remembers the total number of nodes in a tree. When two trees merge, the smaller tree is merged into the larger tree. (In other words, the root of the smaller tree becomes a child of the other root.) 1. (8%) Is it true that when two trees merge, the shorter tree is always merged into the taller tree? Prove your answer formally or provide a counterexample with brief explanations. 2. (8%) Is it true that any tree with height h must have at least 2h1 nodes (for all h)? Prove your answer formally or provide a counterexample with brief explanations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!