Skip to content

Commit 169b54d

Browse files
committed
add correspondind leetcode problem link
1 parent cd47e3e commit 169b54d

9 files changed

Lines changed: 173 additions & 4 deletions

File tree

.idea/algorithm010.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Week01/NOTE.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,44 @@ class ListNode:
99
self.val = val
1010
self.next = next
1111

12-
dummy = ListNode(0) #作为头节点使用,具体的值不重要,最后输出dummy.next即可
12+
dummy = p = ListNode(0) #作为头节点使用,具体的值不重要,最后输出dummy.next即可
13+
for i in range(10):
14+
next_val = i
15+
p.next = ListNode(next_val) # p用作移动指针
16+
p = p.next
17+
return dummy.next
1318
```
19+
有关哑节点使用的题:
1420

15-
21+
| 题号 | 名字 |
22+
| :------: | :------:|
23+
| [LeetCode 2](https://leetcode.com/problems/add-two-numbers/) | Add Two Numbers|
1624

25+
数组、链表、跳表 相关题:
26+
27+
| 分类 | 题目 |
28+
| :------: | :------:|
29+
|数组遍历, 双指针| [LC 11 盛水最多的容器](https://leetcode.com/problems/container-with-most-water/) |
30+
|数组遍历, 双指针| [LC 283 移动零](https://leetcode.com/problems/move-zeroes/) |
31+
|数组存储, 动态规划|[LC 70 爬楼梯](https://leetcode.com/problems/climbing-stairs/)|
32+
|数组和字典|[LC 1 两数之和](https://leetcode.com/problems/two-sum/)|
33+
|数组存储, 动态规划|[LC 15 三数之和](https://leetcode.com/problems/3sum/)|
34+
|链表|[LC 206 反转链表](https://leetcode.com/problems/reverse-linked-list/)|
35+
|链表|[LC 24 两两交换链表中的节点](https://leetcode.com/problems/swap-nodes-in-pairs/)|
36+
|链表, 快慢指针|[LC 141 环形链表](https://leetcode.com/problems/linked-list-cycle/)|
37+
|链表, 快慢指针|[LC 142 环形链表 II](https://leetcode.com/problems/linked-list-cycle-ii/)|
38+
|链表, 快慢指针|[LC 876 链表中点](https://leetcode.com/problems/middle-of-the-linked-list/)|
39+
|链表, 快慢指针|[链表中倒数第k个元素](https://leetcode-cn.com/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/)|
40+
|链表|[LC 25 K个一组反转链表](https://leetcode.com/problems/reverse-nodes-in-k-group/)|
41+
42+
栈、队列、优先队列、双端队列 相关题:
43+
44+
|分类|题目|
45+
|:------:|:------:|
46+
|源码|[python 中的高性能库](https://docs.python.org/3/library/collections.html)|
47+
||[LC 20 有效的括号](https://leetcode.com/problems/valid-parentheses/)|
48+
||[LC 155 最小栈](https://leetcode.com/problems/min-stack/)|
49+
||[LC 84 柱状图中最大的矩形](https://leetcode.com/problems/largest-rectangle-in-histogram/)|
50+
||[LC 239 滑动窗口的最大值](https://leetcode.com/problems/sliding-window-maximum/)|
51+
|队列|[LC 641 设计双端循环队列](https://leetcode.com/problems/design-circular-deque/)|
52+
|栈, 单调栈|[LC 42 接雨水](https://leetcode.com/problems/trapping-rain-water/)|

Week02/NOTE.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def postorder(node):
4848

4949
+ Heap
5050
+ 堆可以看作是一个API, heap[0] 可以返回这个堆的最大值或者是最小值
51-
+ python 中的堆默认为是小顶堆
51+
+ python 中的堆默认为是小顶堆
52+
+ [python heapq 的源码](https://docs.python.org/3/library/heapq.html)
5253
```python
5354
import heapq as h
5455

@@ -75,3 +76,34 @@ heap = nums
7576
h.heapify(heap)
7677

7778
```
79+
哈希表(字典)、映射、集合 有关题:
80+
81+
|分类|题目|
82+
|:------:|:------:|
83+
|字典|[LC 242 有效字母异位词](https://leetcode-cn.com/problems/valid-anagram/description/)|
84+
|字典|[LC 49 字母异位词分组](https://leetcode-cn.com/problems/group-anagrams/)|
85+
|字典|[LC 1 两数之和](https://leetcode-cn.com/problems/two-sum/description/)|
86+
87+
树、二叉树、[二叉搜索树](https://visualgo.net/zh/bst?slide=1) 有关题:
88+
89+
|分类|题目|
90+
|:------:|:------:|
91+
|二叉树遍历|[LC94 二叉树的中序遍历](https://leetcode-cn.com/problems/binary-tree-inorder-traversal/)|
92+
|二叉树遍历|[LC144 二叉树的前序遍历](https://leetcode-cn.com/problems/binary-tree-preorder-traversal/)|
93+
|N叉树遍历|[LC590 N叉树的后序遍历](https://leetcode-cn.com/problems/n-ary-tree-postorder-traversal/)|
94+
|N叉树遍历|[LC589 N叉树的前序遍历](https://leetcode-cn.com/problems/n-ary-tree-preorder-traversal/description/)|
95+
|N叉树遍历|[LC429 N叉树的层序遍历](https://leetcode-cn.com/problems/n-ary-tree-level-order-traversal/)|
96+
97+
堆、二叉堆、图 相关题:
98+
99+
|分类|题目|
100+
|:------:|:------:|
101+
||[剑指 Offer 40. 最小的k个数](https://leetcode-cn.com/problems/zui-xiao-de-kge-shu-lcof/)|
102+
||[239. 滑动窗口最大值](https://leetcode-cn.com/problems/sliding-window-maximum/)|
103+
||[剑指 Offer 49. 丑数](https://leetcode-cn.com/problems/chou-shu-lcof/)|
104+
||[347. 前 K 个高频元素](https://leetcode-cn.com/problems/top-k-frequent-elements/)|
105+
|源码实现,堆|[HeapSort](https://www.geeksforgeeks.org/heap-sort/)|
106+
||[连通图个数](https://leetcode-cn.com/problems/number-of-islands/)|
107+
||[拓扑排序 (Topological Sorting)](https://zhuanlan.zhihu.com/p/34871092)|
108+
||[最短路径(Shortest Path):Dijkstra](https://www.bilibili.com/video/av25829980?from=search&seid=13391343514095937158)|
109+
||[最小生成树 (Minimum Spanning Tree)](https://www.bilibili.com/video/av84820276?from=search&seid=17476598104352152051)|

Week03/NOTE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,31 @@ def divide_conquer(problem, parma1, param2, ...):
5656

5757
# revert the current level states
5858
```
59+
60+
泛型递归、树的递归 相关题:
61+
62+
|分类|题目|
63+
|:------:|:------:|
64+
|泛型递归|[70. 爬楼梯](https://leetcode-cn.com/problems/climbing-stairs/)|
65+
|泛型递归|[22. 括号生成](https://leetcode-cn.com/problems/generate-parentheses/)|
66+
|泛型递归|[77. 组合](https://leetcode-cn.com/problems/combinations/)|
67+
|泛型递归|[46. 全排列](https://leetcode-cn.com/problems/permutations/)|
68+
|泛型递归|[47. 全排列 II](https://leetcode-cn.com/problems/permutations-ii/)|
69+
|树的递归|[226. 翻转二叉树](https://leetcode-cn.com/problems/invert-binary-tree/description/)|
70+
|树的递归|[98. 验证二叉搜索树](https://leetcode-cn.com/problems/validate-binary-search-tree/)|
71+
|树的递归|[104. 二叉树的最大深度](https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/)|
72+
|树的递归|[111. 二叉树的最小深度](https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/)|
73+
|树的递归|[297. 二叉树的序列化与反序列化](https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/)|
74+
|树的递归|[236. 二叉树的最近公共祖先](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/)|
75+
|树的递归|[105. 从前序与中序遍历序列构造二叉树](https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)|
76+
77+
分治、回溯 相关题:
78+
79+
|分类|题目|
80+
|:------:|:------:|
81+
|分治|[50. Pow(x, n)](https://leetcode-cn.com/problems/powx-n/) [牛顿迭代法](http://www.matrix67.com/blog/archives/361) [代码](http://www.voidcn.com/article/p-eudisdmk-zm.html)|
82+
|分治|[78. 子集](https://leetcode-cn.com/problems/subsets/)|
83+
|分治|[169. 多数元素](https://leetcode-cn.com/problems/majority-element/description/)|
84+
|分治|[17. 电话号码的字母组合](https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/)|
85+
|分治|[51. N皇后](https://leetcode-cn.com/problems/n-queens/)|
86+
|分治|[]()|

Week04/NOTE.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,39 @@ while left <= right:
5454
left = mid + 1
5555
else:
5656
right = mid - 1
57-
```
57+
```
58+
59+
深度优先搜索、广度优先搜索 相关题:
60+
61+
|分类|题目|
62+
|:------:|:------:|
63+
|BFS|[102. 二叉树的层序遍历](https://leetcode-cn.com/problems/binary-tree-level-order-traversal/#/description)|
64+
|DFS|[433. 最小基因变化](https://leetcode-cn.com/problems/minimum-genetic-mutation/#/description)|
65+
|DFS|[22. 括号生成](https://leetcode-cn.com/problems/generate-parentheses/#/description)|
66+
|BFS|[515. 在每个树行中找最大值](https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/#/description)|
67+
|BFS|[127. 单词接龙](https://leetcode-cn.com/problems/word-ladder/)|
68+
|BFS|[126. 单词接龙 II](https://leetcode-cn.com/problems/word-ladder-ii/description/)|
69+
|DFS|[200. 岛屿数量](https://leetcode-cn.com/problems/number-of-islands/)|
70+
|DFS|[529. 扫雷游戏](https://leetcode-cn.com/problems/minesweeper/description/)|
71+
72+
贪心算法 相关题:
73+
74+
|分类|题目|
75+
|:------:|:------:|
76+
|贪心|[322. 零钱兑换](https://leetcode-cn.com/problems/coin-change/)|
77+
|贪心|[860. 柠檬水找零](https://leetcode-cn.com/problems/lemonade-change/description/)|
78+
|贪心|[122. 买卖股票的最佳时机 II](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/description/)|
79+
|贪心|[455. 分发饼干](https://leetcode-cn.com/problems/assign-cookies/)|
80+
|贪心|[874. 模拟行走机器人](https://leetcode-cn.com/problems/walking-robot-simulation/description/)|
81+
|贪心|[55. 跳跃游戏](https://leetcode-cn.com/problems/jump-game/)|
82+
|贪心|[45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/)|
83+
84+
二分查找 相关题:
85+
86+
|分类|题目|
87+
|:------:|:------:|
88+
|二分, 找一个值|[69. x 的平方根](https://leetcode-cn.com/problems/sqrtx/) -> [Fast InvSqrt() 扩展阅读](https://www.beyond3d.com/content/articles/8/)|
89+
|二分, 找一个值|[367. 有效的完全平方数](https://leetcode-cn.com/problems/valid-perfect-square/)|
90+
|二分, 分段单调, 找一个值|[33. 搜索旋转排序数组](https://leetcode-cn.com/problems/search-in-rotated-sorted-array/)|
91+
|二分, 二维空间, 找一个值|[74. 搜索二维矩阵](https://leetcode-cn.com/problems/search-a-2d-matrix/)|
92+
|二分, 分段单调, 找一个值|[153. 寻找旋转排序数组中的最小值](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/)|

0 commit comments

Comments
 (0)