https://leetcode.com/problems/maximum-depth-of-binary-tree/description/
解题思路:用preorder方法
代码:
class Solution {
public int maxDepth(TreeNode root) {
if(root == null) return 0;
return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
}
}