104. Maximum Depth of Binary Tree

。。没啥说的

1 public int maxDepth(TreeNode root) {
2         if(root == null) {
3             return 0;
4         }
5         return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
6     }

 

posted @ 2016-06-10 03:14  warmland  阅读(93)  评论(0编辑  收藏  举报