MOC-Leetcode-数据结构
数组
数组问题常用技巧
- 双指针(左右指针,快慢指针)
- 滑动窗口
- 差分技巧
- 前缀和技巧
- 田忌赛马
可以在这里查看笔记:数组笔记
Leetcode Hot 100 中的数组题目:题库 - 力扣 (LeetCode)
table
tags AS "Tags",
level AS "难度"
from "300_CSNotes/302_Leetcode/302_atom"
where contains(file.tags, "算法/数组")
sort file.ctime链表
技巧
- 注意哨兵节点
dummy技巧- Python中,
node.next所代表的是一个类(ListNode)- 遇到链表题的时候,要注意
cur节点继续往下走别忘了,建议把所有节点往下走的代码一起写。- 如何找到链表的中点:快慢指针
- 想直到链表的长度,只能遍历。
可以在这里查看笔记:链表笔记
Leetcode Hot 100 中的链表题目:题库 - 力扣 (LeetCode)
table
tags AS "Tags",
level AS "难度"
from "300_CSNotes/302_Leetcode/302_atom"
where contains(file.tags, "算法/链表")
sort file.ctime二叉树
可以在这里查看笔记:二叉树笔记
很好的笔记合集LFool’s Notes
Leetcode Hot 100 中的二叉树题目:题库 - 力扣 (LeetCode)
table
tags AS "Tags",
level AS "难度"
from "300_CSNotes/302_Leetcode/302_atom"
where contains(file.tags, "算法/二叉树")
sort file.ctime| 序号 | 题目 | 难度 | 标签 |
|---|---|---|---|
| 144 | 二叉树的前序遍历 | easy | 二叉树 |
| 96 | 二叉树的中序遍历 | easy | 二叉树 |
| 145 | 二叉树的后序遍历 | easy | 二叉树 |
| 剑32 | 从上到下打印二叉树1 | medium | BFS 二叉树 |
| 101 | 对称二叉树 | easy | 二叉树 递归 栈 队列 |
| 102 | 二叉树的层次遍历 | medium | 二叉树 队列 |
| 104 | 二叉树的最大深度 | easy | 二叉树 BFS DFS |
| 114 | 二叉树展开为链表 | medium | 二叉树 |
| 236 | 二叉树的最近公共祖先 | medium | 二叉树 DFS |
| 617 | 合并二叉树 | easy | 二叉树 BFS DFS |
| 112 | 路径总和 | easy | 二叉树 BFS DFS |
| 113 | 路径总和II | medium | 回溯 二叉树 |
| 剑26 | 树的子结构 | medium | 二叉树 |
| 543 | 二叉树的直径 | easy | 二叉树 |
| 105 | 从前序与中序遍历构造二叉树 | medium | 二叉树 |
| 437 | 路径总和III | medium | 二叉树 回溯 |
| 124 | 二叉树的最大路径和 | hard | 二叉树 DFS |
字符串
Leetcode Hot 100 中的字符串题目:
Python中字符串的常用操作 Python-String-字符串常见操作
table
level AS "难度",
tags AS "Tags"
from "300_CSNotes/302_Leetcode/302_atom"
where contains(file.tags, "算法/字符串")
sort file.ctime栈
可以在这里查看笔记:栈笔记
Leetcode Hot 100 中的关于栈的题目:题库 - 力扣 (LeetCode)
| 序号 | 题目 | 难度 | 标签 |
|---|---|---|---|
哈希表
可以在这里查看笔记:哈希表笔记
Leetcode Hot 100 中关于哈希表的题目
| 序号 | 题目 | 难度 | 标签 |
|---|---|---|---|