Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Merging two binary trees

807580Mar 24 2010 — edited Mar 31 2010
Hi fellow programmers here, i have a question:

let say user input 2 binary tree

Tree1
         1
   2         3
4    5    6   7
Tree2
          8
   9          10
11 12   13   14
how to combine them to make it look like this:

newTree
                  - (empty root)
          1                                8
      2      3                          9       10
   4    5   6   7                     11  12  13  14
where Tree1 and Tree2 is the left and right child of newTree.

Your help is appreciated
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2010
Added on Mar 24 2010
10 comments
689 views