郑州郑州网站建设河南做网站公司哪家好,嘉定网站设计制作报价,宁波建设网图,微信小程序个人网站开发leetcode 102 我模仿二叉树的层序遍历的方法#xff0c;自己写了一个。中间报错了#xff0c;还特别去看了下这个文章https://blog.csdn.net/weixin_45799835/article/details/105780627 后来发现只是一个小错误#xff0c;嘻嘻
class Solution {
public:int maxDepth(Tree…leetcode 102 我模仿二叉树的层序遍历的方法自己写了一个。中间报错了还特别去看了下这个文章https://blog.csdn.net/weixin_45799835/article/details/105780627 后来发现只是一个小错误嘻嘻
class Solution {
public:int maxDepth(TreeNode* root) {int dep0;exp(root,1,dep);return dep;}void exp(TreeNode*root,int c,int dep){ if(!root) return;if(cdep)dep;exp(root-left,c1,dep);exp(root-right,c1,dep);}
};END