佛说wh
佛说wh
全部
题解 | #二叉树的最大深度#
全部文章
分类
归档
标签
去牛客网
登录
/
注册
题解 | #二叉树的最大深度#
252 浏览
0 回复
2022-08-06
佛说wh
+关注
2022.0806算法第12题二叉树的最大深度
采用递归算法计算,递归左子树和右子树。
if(root==NULL) return 0; return max(maxDepth(root->left),maxDepth(root->right))+1;
二叉树
C++
举报
收藏
赞
评论加载中...