@@ -0,0 +1,423 @@
+package LeetCode;%0A%0Apublic class SameTree %7B%0A%09public boolean isSameTree(TreeNode p, TreeNode q) %7B%0A%09%09return isEqual(p, q);%0A%09%7D%0A%0A%09public boolean isEqual(TreeNode p, TreeNode q) %7B%0A%09%09if (p != null && q != null) %7B%0A%09%09%09if (p.val != q.val) %7B%0A%09%09%09%09return false;%0A%09%09%09%7D else %7B%0A%09%09%09%09return isEqual(p.left, q.left) && isEqual(p.right, q.right);%0A%09%09%09%7D%0A%09%09%7D else if (p == null && q == null) %7B%0A%09%09%09return true;%0A%09%09%7D else %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%7D%0A%7D%0A

add same tree