LeetCode | 双指针
整理 LeetCode 双指针题目的核心思路:用两个指针描述位置或范围,并按规则移动,涵盖移动零、盛水容器、三数之和、接雨水、最长回文子串。
Cover Image of the Post
LeetCode | 哈希表
整理 LeetCode 哈希表题目的核心思路:先建表,再查表。
Cover Image of the Post
LeetCode | list、dict、set 有什么区别?
整理 LeetCode 刷题中常用的 Python list、dict、set 与 defaultdict(list) 基础区别。
Cover Image of the Post
LeetCode | 三数之和
LeetCode 三数之和题解:先排序,再固定一个数并用双指针寻找不重复三元组。
Cover Image of the Post
LeetCode | 合并两个有序链表
LeetCode 合并两个有序链表题解:双指针遍历比较节点值,dummy 虚拟头节点串联结果链表。
Cover Image of the Post
LeetCode | 两数相加
LeetCode 两数相加题解:模拟竖式逐位相加,dummy 虚拟头节点串联结果链表,维护 carry 进位。
Cover Image of the Post
LeetCode | 最长回文子串
LeetCode 最长回文子串题解:中心扩展法枚举每个奇偶中心向两侧扩展,时间复杂度 O(n²),空间复杂度 O(1)。
Cover Image of the Post
LeetCode | 反转链表
LeetCode 反转链表题解:使用迭代法逐个翻转节点指向,时间复杂度 O(n),空间复杂度 O(1)。
Cover Image of the Post
LeetCode | 有效的括号
LeetCode 有效的括号题解:使用栈解决括号匹配问题,字典映射右括号到左括号,时间复杂度 O(n)。
Cover Image of the Post
LeetCode | 寻找两个正序数组的中位数
LeetCode 寻找两个正序数组的中位数题解:用二分查找切分位置,在 O(log(min(m,n))) 时间内求中位数。
Cover Image of the Post
LeetCode | 寻找旋转排序数组中的最小值
LeetCode 寻找旋转排序数组中的最小值题解:比较 nums[mid] 与 nums[right],定位旋转断点。
Cover Image of the Post
LeetCode | 搜索旋转排序数组
LeetCode 搜索旋转排序数组题解:在旋转数组中判断有序半区,再用二分缩小范围。
Cover Image of the Post
访客信息
--°天气加载中

正在获取所在地区…

💨 风力--
💧 湿度--

正在读取天气

Profile Image of the Author
平昊阳
乘长风,破巨浪, 展鸿图于未央!
公告
欢迎来到我的个人博客!欢迎关注交流吖!
更多相关公告,见
「社交-留言」。
音乐
封面

音乐

暂未播放

0:000:00
暂无歌词
站点统计
文章
448
分类
29
标签
451
总字数
6,178,652
运行时长
0 天
最后活动
0 天前
最新动态

文章目录