1 public class Solution { 2 public int maxDepth(TreeNode root) { 3 if(root==null) 4 return 0; 5 return Math.max(maxDepth(root.left),maxDepth(root.right))+1; 6 } 7 }
相关文章
- 12-21LeetCode(53)-Binary Tree Paths
- 12-21leetcode -- 110. Balanced Binary Tree
- 12-21balanced-binary-tree
- 12-21LeetCode开心刷题五十二天——110. Balanced Binary Tree
- 12-21binary-tree-preorder-traversal
- 12-21Baozi Leetcode Solution 199: Binary Tree Right Side View
- 12-21LeetCode-94-Binary Tree Inorder Traversal
- 12-21Binary Tree Preorder Traversal
- 12-21543.Diameter of Binary Tree
- 12-21[LC] 543. Diameter of Binary Tree