100.Same Tree Posted on 2017-09-24 | In LeetCode Solution 1: accepted 0ms1234567891011121314public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { if (p == null && q == null) { // both p, q are null return true; } else if (p != null && q != null) { // both p, q are not null return (p.val == q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right)); } else { // one of p, q is null return false; } }}