标签:
。。没啥说的
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 }
104. Maximum Depth of Binary Tree
原文地址:http://www.cnblogs.com/warmland/p/5573083.html