Question: Q4 (2 points): Suppose you are given two 2-3 trees Ti, T2 and a value such that all keys in T1 are less than x,

 Q4 (2 points): Suppose you are given two 2-3 trees Ti,

Q4 (2 points): Suppose you are given two 2-3 trees Ti, T2 and a value such that all keys in T1 are less than x, and all keys in T2 are greater than r. Give an algorithm that constructs a single new T that has the union of keys in Ti, T2, and x. Give a running time analysis. (Hint: obviously, you shouldn't rebuild T' from scratch, or this wouldn't be a homework question. Think about how you can attach the smaller tree to the bigger tree in the "right" place. Then, try to fix the 2-3 tree properties.) Q4 (2 points): Suppose you are given two 2-3 trees Ti, T2 and a value such that all keys in T1 are less than x, and all keys in T2 are greater than r. Give an algorithm that constructs a single new T that has the union of keys in Ti, T2, and x. Give a running time analysis. (Hint: obviously, you shouldn't rebuild T' from scratch, or this wouldn't be a homework question. Think about how you can attach the smaller tree to the bigger tree in the "right" place. Then, try to fix the 2-3 tree properties.)

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!