Skip to content

Commit 0527d0f

Browse files
authored
Merge pull request gzc426#390 from Jerring/master
1
2 parents 088a969 + a390377 commit 0527d0f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

2018.12.07-leetcode104/TheRocket.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```java
2+
/**
3+
* Definition for a binary tree node.
4+
* public class TreeNode {
5+
* int val;
6+
* TreeNode left;
7+
* TreeNode right;
8+
* TreeNode(int x) { val = x; }
9+
* }
10+
*/
11+
class Solution {
12+
public int maxDepth(TreeNode root) {
13+
if (root == null) {
14+
return 0;
15+
}
16+
return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
17+
}
18+
}
19+
```

0 commit comments

Comments
 (0)