思路都在注解里
/** 递归终止的边界为 root == null*/
if (root == null) return 0;
/** 问题与子问题间的关系 :
* 返回左结点深度
* 返回右结点深度
* 比较两个子节点的深度,返回最大的那个
* Math.max(maxDepth(root.left),maxDepth(root.right))*/
return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;