Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加前置知识标签 #384

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions problems/20.validParentheses.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Input: "{[]}"
Output: true
```

## 前置知识

- 栈

## 思路

关于这道题的思路,邓俊辉讲的非常好,没有看过的同学可以看一下, [视频地址](http://www.xuetangx.com/courses/course-v1:TsinghuaX+30240184+sp/courseware/ad1a23c053df4501a3facd66ef6ccfa9/8d6f450e7f7a445098ae1d507fda80f6/)。
Expand Down
5 changes: 5 additions & 0 deletions problems/23.merge-k-sorted-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ https://leetcode-cn.com/problems/merge-k-sorted-lists/description/
]
输出: 1->1->2->3->4->4->5->6

## 前置知识

- 链表
- 归并排序

## 思路

这道题目是合并 k 个已排序的链表,号称 leetcode 目前`最难`的链表题。 和之前我们解决的[88.merge-sorted-array](./88.merge-sorted-array.md)很像。
Expand Down
5 changes: 5 additions & 0 deletions problems/24.swapNodesInPairs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ You may not modify the values in the list's nodes, only nodes itself may be chan
Example:

Given 1->2->3->4, you should return the list as 2->1->4->3.

## 前置知识

- 链表

## 思路

设置一个dummy 节点简化操作,dummy next 指向head。
Expand Down
4 changes: 4 additions & 0 deletions problems/25.reverse-nodes-in-k-groups-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ You may not alter the values in the list's nodes, only nodes itself may be chang

```

## 前置知识

- 链表

## 思路
题意是以 `k` 个nodes为一组进行翻转,返回翻转后的`linked list`.

Expand Down
4 changes: 4 additions & 0 deletions problems/26.remove-duplicates-from-sorted-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ for (int i = 0; i < len; i++) {
}
```

## 前置知识

- 双指针

## 思路

使用快慢指针来记录遍历的坐标。
Expand Down
4 changes: 4 additions & 0 deletions problems/29.divide-two-integers.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Assume we are dealing with an environment which could only store integers within

```

## 前置知识

- 二分法

## 思路

符合直觉的做法是,减数一次一次减去被减数,不断更新差,直到差小于0,我们减了多少次,结果就是多少。
Expand Down
4 changes: 4 additions & 0 deletions problems/31.next-permutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Here are some examples. Inputs are in the left-hand column and its corresponding

```

## 前置知识

- 回溯法

## 思路

符合直觉的方法是我们按顺序求出所有的排列,如果当前排列等于 nums,那么我直接取下一个
Expand Down
4 changes: 4 additions & 0 deletions problems/32.longest-valid-parentheses.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Output: 4
Explanation: The longest valid parentheses substring is "()()"
```

## 前置知识

- 动态规划

## 思路(动态规划)

所有的动态规划问题, 首先需要解决的就是如何寻找合适的子问题.
Expand Down
5 changes: 5 additions & 0 deletions problems/33.search-in-rotated-sorted-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Output: -1

```

## 前置知识

- 数组
- 二分法

## 思路

这是一个我在网上看到的前端头条技术终面的一个算法题。
Expand Down
4 changes: 4 additions & 0 deletions problems/39.combination-sum.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ A solution set is:

```

## 前置知识

- 回溯法

## 思路

这道题目是求集合,并不是`求极值`,因此动态规划不是特别切合,因此我们需要考虑别的方法。
Expand Down
4 changes: 4 additions & 0 deletions problems/40.combination-sum-ii.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ A solution set is:

```

## 前置知识

- 回溯法

## 思路

这道题目是求集合,并不是`求极值`,因此动态规划不是特别切合,因此我们需要考虑别的方法。
Expand Down