/* * 104. Maximum Depth of Binary Tree * 11.19 By Mingyang * 同样可以用queue,注意!queue不能用null来判决,queue应该用size()来判断的 */ public int maxDepth(TreeNode root) { if (root == null) return 0; return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1; }