classSolution{publicintmaxDepth(TreeNode root){if(root==null)return0;int l =maxDepth(root.left);int r =maxDepth(root.right);if(l>=r)return l+1;elsereturn r+1;}}
Day 1.28二叉树的最大深度题目代码class Solution { public int maxDepth(TreeNode root) { if(root==null)return 0; int l = maxDepth(root.left); int r = maxDepth(root.right); if(l>=r)return l+1; else return r+1; }}结