摘要: 235. 二叉搜索树的最近公共祖先 文章链接:https://programmercarl.com/0235.二叉搜索树的最近公共祖先.html 题目链接:https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-search-t 阅读全文
posted @ 2024-11-10 12:09 W-Vicky11 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 530.二叉搜索树的最小绝对差 文章链接:https://programmercarl.com/0530.二叉搜索树的最小绝对差.html 视频链接:https://www.bilibili.com/video/BV1DD4y11779/?vd_source=6cb513d59bf1f73f86d4 阅读全文
posted @ 2024-11-10 09:51 W-Vicky11 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 654.最大二叉树 文章链接:https://programmercarl.com/0654.最大二叉树.html 题目链接:https://leetcode.cn/problems/maximum-binary-tree/description/ class Solution { public: 阅读全文
posted @ 2024-11-09 16:47 W-Vicky11 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 513.找树左下角的值 文章链接:https://programmercarl.com/0513.找树左下角的值.html 题目链接:https://leetcode.cn/problems/find-bottom-left-tree-value/description/ 要点:不管是前中后序遍历, 阅读全文
posted @ 2024-11-08 21:48 W-Vicky11 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 110.平衡二叉树 文章链接:https://programmercarl.com/0110.平衡二叉树.html#题外话 题目链接:https://leetcode.cn/problems/balanced-binary-tree/description/ class Solution { pub 阅读全文
posted @ 2024-11-08 16:45 W-Vicky11 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 226.翻转二叉树 文章链接:https://programmercarl.com/0226.翻转二叉树.html#算法公开课 题目链接:https://leetcode.cn/problems/invert-binary-tree/description/ 迭代法: 这里使用了前序遍历来交换左右孩 阅读全文
posted @ 2024-10-25 10:56 W-Vicky11 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 前置知识 二叉树的定义: struct BNode{ int val; BNode* lchild; BNode* rchild; BNode():lchild(NULL),rchild(NULL){} BNode(int val){ val=val; lchild=rchild=NULL; } } 阅读全文
posted @ 2024-10-24 20:14 W-Vicky11 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 150. 逆波兰表达式求值 文章链接:https://programmercarl.com/0150.逆波兰表达式求值.html#算法公开课 题目链接:https://leetcode.cn/problems/evaluate-reverse-polish-notation/description/ 阅读全文
posted @ 2024-10-23 23:57 W-Vicky11 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 前置知识 文章链接:https://programmercarl.com/0028.实现strStr.html#思路 KMP的经典思想就是:当出现字符串不匹配时,可以记录一部分之前已经匹配的文本内容,利用这些信息避免从头再去做匹配。 前缀表:next数组就是一个前缀表(prefix table)。前 阅读全文
posted @ 2024-10-23 17:29 W-Vicky11 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 前置知识 栈和队列都是以deque为缺省底部结构,实际上可以自己指定vector,deque,list都可以 栈和队列都被归类为container adapter( 容器适配器) 使用栈实现队列的操作: push(x) -- 将一个元素放入队列的尾部。 pop() -- 从队列首部移除元素。 pee 阅读全文
posted @ 2024-10-10 17:28 W-Vicky11 阅读(374) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示