You are given two height balanced binary search trees T and T’,
storing m and n elements respectively. Every element of tree T is
smaller than every element of tree T’. Every node u also stores height
of the subtree rooted at it. Using this extra information how can you
merge the two trees in time
Find the node in T which is the maximum(which is either the root or the
rightmost in the right subtree).
After finding this node, just make the right child of this node point to the
root of T'.
Correct me if i am wrong
On Fri, Jan 21, 2011 at 2:43 PM, snehal jain learner@gmail.com wrote:
@ above height will not be balanced then
On 21 January 2011 19:15, nishaanth nishaant...@gmail.com wrote:
Find the node in T which is the maximum(which is either the root or the
rightmost in the right subtree).
After finding this node, just make the right child of this node point to
the root