11 2024 档案
摘要:岛屿的数量 题目链接:https://leetcode.cn/problems/number-of-islands/ 此题目要点:dfs和bfs都可以解决此题,但是使用dfs代码会更加的简洁 首先对grid进行遍历,每一个节点都进行检查,判断是否是1(陆地) 如果是,则进行dfs深搜,并将所有搜到的
阅读全文
摘要:所有可达路径 文章链接:https://programmercarl.com/kamacoder/0098.所有可达路径.html#本题代码 题目链接:https://kamacoder.com/problempage.php?pid=1170 #include <iostream> #includ
阅读全文
摘要:669. 修剪二叉搜索树 文章链接:https://programmercarl.com/0669.修剪二叉搜索树.html 题目链接:https://leetcode.cn/problems/trim-a-binary-search-tree/description/ class Solution
阅读全文
摘要:235. 二叉搜索树的最近公共祖先 文章链接:https://programmercarl.com/0235.二叉搜索树的最近公共祖先.html 题目链接:https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-search-t
阅读全文
摘要:530.二叉搜索树的最小绝对差 文章链接:https://programmercarl.com/0530.二叉搜索树的最小绝对差.html 视频链接:https://www.bilibili.com/video/BV1DD4y11779/?vd_source=6cb513d59bf1f73f86d4
阅读全文
摘要:654.最大二叉树 文章链接:https://programmercarl.com/0654.最大二叉树.html 题目链接:https://leetcode.cn/problems/maximum-binary-tree/description/ class Solution { public:
阅读全文
摘要:513.找树左下角的值 文章链接:https://programmercarl.com/0513.找树左下角的值.html 题目链接:https://leetcode.cn/problems/find-bottom-left-tree-value/description/ 要点:不管是前中后序遍历,
阅读全文
摘要:110.平衡二叉树 文章链接:https://programmercarl.com/0110.平衡二叉树.html#题外话 题目链接:https://leetcode.cn/problems/balanced-binary-tree/description/ class Solution { pub
阅读全文