![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
饼干饼干圆又圆
这个作者很懒,什么都没留下…
展开
-
刷leetcode的简单题第一次复盘(二)
N叉树的数据结构 struct Node{ int val; int numChildren; struct Node **children; } 求N叉树的最大深度 int maxDepth(struct Node *root){ if(root==NULL){ return 0; } int max = 0; for(int i=0;i<root->numChildren;i++){ int temp = maxDepth(root->children[i]);原创 2021-03-10 13:41:47 · 133 阅读 · 0 评论 -
刷LeetCode的第一次小复盘
全为C语言的简单题 二叉树,每个结点最多两颗子树,次序不能颠倒,有左右之分。 struct TreeNode{ int val; struct TreeNode *left; struct TreeNode *right; } 路径总和(递归解法) bool hasPathSum(struct TreeNode *root,int targetSum){ if(!root){ return false; } targetSum = targetSum - root->val; if原创 2021-03-08 15:54:22 · 148 阅读 · 0 评论