@@ -0,0 +1,1653 @@
+/**%0A *Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.%0A *%0A *You need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of new tree.%0A *%0A *Example 1:%0A *Input: %0A *%09Tree 1                     Tree 2                  %0A *          1                         2                             %0A *         / %5C                       / %5C                            %0A *        3   2                     1   3                        %0A *       /                           %5C   %5C                      %0A *      5                             4   7                  %0A *Output: %0A *Merged tree:%0A *%09     3%0A *%09    / %5C%0A *%09   4   5%0A *%09  / %5C   %5C %0A *%09 5   4   7%0A *Note: The merging process must start from the root nodes of both trees.%0A *%0A * Definition for a binary tree node.%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    public TreeNode mergeTrees(TreeNode t1, TreeNode t2) %7B%0A        if (t1 == null && t2 == null) %7B%0A            return null;%0A        %7D%0A        %0A        int val = (t1 == null ? 0 : t1.val) + (t2 == null ? 0 : t2.val);%0A        TreeNode treeNode = new TreeNode(val);%0A        %0A        treeNode.left = mergeTrees((t1 == null ? null : t1.left), (t2 == null ? null : t2.left));%0A        treeNode.right = mergeTrees((t1 == null ? null : t1.right), (t2 == null ? null : t2.right));%0A        return treeNode;%0A    %7D%0A%7D%0A

Create MergeTwoBinaryTrees.java