Skip to content

Commit 05bb9fe

Browse files
committed
Trees
1 parent 4ea04e4 commit 05bb9fe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/leetcode2018/Trees.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
9797
}
9898

9999
public boolean isSameTree(TreeNode p, TreeNode q) {
100-
if(p==null && q==null) return true;
101-
if(p==null || q==null) return false;
102-
if(p.val!=q.val) return false;
103-
return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
104-
}
100+
if(p==null && q==null) return true;
101+
if(p==null || q==null) return false;
102+
if(p.val!=q.val) return false;
103+
return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
104+
}
105105

106106
}
107107

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy