Question: The following algorithm merges two binary search trees into one binary search tree. Let T1 and T2 be two BSTs such that T1 conatins n
The following algorithm merges two binary search trees into one binary search tree. Let T1 and T2 be two BSTs such that T1 conatins n and T2 contains m integer values, where n>m>0. Below is a simple algorithm for merging T1 and T2:
a.) Describe the running time of this algorithm using big-O notation. Note that T1 contains n nodes and T2 contains m nodes, Therefore, your running time must be a function of both n and m. (First desrcibe the running time of each step, then compute overall running time)
b.)

Merge BST-V1 1 T 2 1. for each node node in T2 remove node from T2 insert the value of node into T 2. return T
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
