- 1 -
1. (15 points) Consider a find operation on the partition data structure in which the “find
path” has 21 nodes. What is the smallest number of nodes that the partition data structure
could contain. Explain your answer.
Since ranks must increase as you go up the find path, the rank of the root must be at least 20. Since
the rank is at most lg n, we must have at least 220 nodes.
In the O(m log log n) analysis of the partition data structure, we defined the notion of a
dominant node. Suppose the partition data structure has 16 million nodes. If the root of the
tree involved in the above find operation has a rank of 30, what is the maximum number of
nodes along the find path that could be dominant? Explain your answer.
The
Δ
values for the dominant nodes must increase by more than a factor of >2 as you go up the find
path, so to maximize the number of dominant nodes, we could have the sequence of
Δ
values: 1, 3, 7,
15. The next
Δ
value in the sequence is 31 which is too large, given that the rank of the root is just 30.
So, there can be at most 4 dominant nodes. In fact, since the other nodes have a
Δ
of at least 1, even
four dominant nodes is too many to keep the rank of the root from exceeding 30. With 3 dominant
nodes, we can have 17 non-dominant nodes with a
Δ
of 1. Adding this to 1+3+7 gives 28, which is
smaller than the given root rank of 30. So the maximum number of dominant nodes is 3.
Consider a node x with rank(x)=0 and rank(p(x))=8. Suppose we perform three operations
involving node x and x is not dominant immediately before each of these find operations.
What is the smallest possible value that rank(p(x)) can have after these three find operations
have completed? Explain your answer.
Each of the finds must increase the rank(x) by at least a factor of 3/2. So, the three finds increase it
from 8 to at least 8(3/2)3=27.