Question: The following binary search tree (BST) operations can be implemented efficiently on splay trees. For simplicity, assume that all elements are distinct. Join (T,T2): Assume

The following binary search tree (BST) operations can be implemented efficiently on splay trees. For simplicity, assume that all elements are distinct. Join (T,T2): Assume every element in BST T is less than or equal to every element in BST T2, and returns the BST formed by combining the trees Ti and T2 SpLit (T, a): Split BST T, containing element a, into two BSTs: Ti containing all elements in T with key less or equal to a; and T2, con- taining all elements in T with key greater than a. Show how to correctly implement those operations on splay trees so that the amortized running time of your operations is O(log n). Justify your procedures and their corresponding running times. Would you be able to also implement the JoIN and SPLIT operations on a Red-Black tree in O(log n) worst-case running time? Briefly justify your answer. The following binary search tree (BST) operations can be implemented efficiently on splay trees. For simplicity, assume that all elements are distinct. Join (T,T2): Assume every element in BST T is less than or equal to every element in BST T2, and returns the BST formed by combining the trees Ti and T2 SpLit (T, a): Split BST T, containing element a, into two BSTs: Ti containing all elements in T with key less or equal to a; and T2, con- taining all elements in T with key greater than a. Show how to correctly implement those operations on splay trees so that the amortized running time of your operations is O(log n). Justify your procedures and their corresponding running times. Would you be able to also implement the JoIN and SPLIT operations on a Red-Black tree in O(log n) worst-case running time? Briefly justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
