Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 05bb9fe

Browse filesBrowse files
committed
Trees
1 parent 4ea04e4 commit 05bb9fe
Copy full SHA for 05bb9fe

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎src/leetcode2018/Trees.java

Copy file name to clipboardExpand all lines: src/leetcode2018/Trees.java
+5-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.