@@ -0,0 +1,720 @@
+/***%0A * Given two binary trees, write a function to check if they are equal or not.%0A *%0A * Two binary trees are considered equal if they are structurally identical and the nodes have the same value.%0A */%0A/**%0A * Definition for binary tree%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 */%0Apublic class Solution %7B%0A    // Solution 1: Recursive O(n), O(log n)%0A    public boolean isSameTree(TreeNode p, TreeNode q) %7B%0A        if (p == null && q == null)%0A            return true;%0A        if (p == null %7C%7C q == null)%0A            return false;%0A%0A        return (p.val == q.val) && isSameTree(p.left, q.left) && isSameTree(p.right, q.right);%0A    %7D%0A%7D%0A

add SameTree.java