题目描述: 解题思路: 首先判断是否为空,若不是则进入判断,通过递归判断长度 代码实现: class Solution { public static int maxDepth(TreeNode root) { if (root == null) { return 0; } return 1 + Math.max(maxDepth(root.left), maxDepth(root.right)); } } 感受: 不得不感叹递归真的太强了