sudharsan said:
please gimme the logic to merge two binary search trees?I mean which
node has to be the root node of the new binary tree??
Thanks in advance
Thanks for monitoring this newsgroup and being aware of what is and
is not topical for it. In the same spirit of co-operation, I offer
the following accurate method:
Install all items in a new tree, using only the left pointer, and
setting all the new right pointers to NULL. Extract the items from
the original trees with an inorder treewalk. When done, sort the
resultant list formed with the left pointers with mergesort. The
result will be a binary search tree.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <
http://cfaj.freeshell.org/google/>
Also see <
http://www.safalra.com/special/googlegroupsreply/>