两句完事。
if(root==null) return 0; return Math.max(maxDepth(root.left),maxDepth(root.right))+1;
暂无评论,快来抢首评~
相关推荐