how to merge two BST's efficiently?
<p>how to merge two binary search trees maintaining the prop of BST...naive way of doing it is</p>

<p>take each element from a tree and insert it into the other...</p>

<p>Complexity of this method being O(n1 * log(n2))..</p>

<p>where n1 is the no of nodes of the tree(say T1) which we have splitted and n2 is the number </p>

<p>of nodes of the other tree(say T2)...</p>

<p>after this operation T2 is the only BST that has n1+n2 nodes...</p>

<p>My question is..Can we do any better than O(n1 * log(n2))?..</p>

<p>thanks in advance..</p>
