Prove that the amortized cost of a top-down splay is O(logN).
Read moreTextbook Solutions for Data Structures and Algorithm Analysis in Java
Question
When viewed graphically, each node in a 2-d tree partitions the plane into regions.For instance, Figure 12.51 shows the first five insertions into the 2-d tree inFigure 12.51 The plane partitioned by a 2-d tree after the insertion of p1 = (53, 14),p2 = (27, 28), p3 = (30, 11), p4 = (67, 51), p5 = (70, 3)Figure 12.52 The plane partitioned by a quad tree after the insertion of p1 = (53, 14),p2 = (27, 28), p3 = (30, 11), p4 = (67, 51), p5 = (70, 3)Figure 12.39. The first insertion, of p1, splits the plane into a left part and aright part. The second insertion, of p2, splits the left part into a top part and abottom part, and so on.a. For a given set of N items, does the order of insertion affect the final partition?b. If two different insertion sequences result in the same tree, is the same partitionproduced?c. Give a formula for the number of regions that result from the partition after Ninsertions.d. Show the final partition for the 2-d tree in Figure 12.39.
Solution
The first step in solving 12 problem number 32 trying to solve the problem we have to refer to the textbook question: When viewed graphically, each node in a 2-d tree partitions the plane into regions.For instance, Figure 12.51 shows the first five insertions into the 2-d tree inFigure 12.51 The plane partitioned by a 2-d tree after the insertion of p1 = (53, 14),p2 = (27, 28), p3 = (30, 11), p4 = (67, 51), p5 = (70, 3)Figure 12.52 The plane partitioned by a quad tree after the insertion of p1 = (53, 14),p2 = (27, 28), p3 = (30, 11), p4 = (67, 51), p5 = (70, 3)Figure 12.39. The first insertion, of p1, splits the plane into a left part and aright part. The second insertion, of p2, splits the left part into a top part and abottom part, and so on.a. For a given set of N items, does the order of insertion affect the final partition?b. If two different insertion sequences result in the same tree, is the same partitionproduced?c. Give a formula for the number of regions that result from the partition after Ninsertions.d. Show the final partition for the 2-d tree in Figure 12.39.
From the textbook chapter Advanced Data Structures
and Implementation
you will find a few key concepts needed to solve this.
Visible to paid subscribers only
Step 3 of 7)Visible to paid subscribers only
full solution