https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/description/
class Solution {
public int maxDepth(TreeNode root) {
if(root == null)
return 0;
int leftres = maxDepth(root.left) + 1;
int rightres = maxDepth(root.right) + 1;
return Math.max(leftres,rightres);
}
}