Skip to content

Commit bd5c7b9

Browse files
committed
feat: update lc problems
1 parent 21a6b29 commit bd5c7b9

File tree

1,311 files changed

+5934
-4496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,311 files changed

+5934
-4496
lines changed

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
- Using welcoming and inclusive language
18-
- Being respectful of differing viewpoints and experiences
19-
- Gracefully accepting constructive criticism
20-
- Focusing on what is best for the community
21-
- Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
- The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
- Trolling, insulting/derogatory comments, and personal or political attacks
28-
- Public or private harassment
29-
- Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
- Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- [乘积小于 K 的子数组](/solution/0700-0799/0713.Subarray%20Product%20Less%20Than%20K/README.md) - `双指针`
5353
- [位 1 的个数](/solution/0100-0199/0191.Number%20of%201%20Bits/README.md) - `位运算``lowbit`
5454
- [合并区间](/solution/0000-0099/0056.Merge%20Intervals/README.md) - `区间合并`
55-
<!-- 排序算法、待补充 -->
55+
<!-- 排序算法、待补充 -->
5656

5757
### 2. 数据结构
5858

README_EN.md

Lines changed: 121 additions & 121 deletions
Large diffs are not rendered by default.

basic/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## 排序算法
44

5-
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
6-
- [插入排序](/basic/sorting/InsertionSort/README.md)
7-
- [希尔排序](/basic/sorting/ShellSort/README.md)
8-
- [选择排序](/basic/sorting/SelectionSort/README.md)
9-
- [归并排序](/basic/sorting/MergeSort/README.md)
10-
- [快速排序](/basic/sorting/QuickSort/README.md)
11-
- [堆排序](/basic/sorting/HeapSort/README.md)
12-
- [计数排序](/basic/sorting/CountingSort/README.md)
5+
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
6+
- [插入排序](/basic/sorting/InsertionSort/README.md)
7+
- [希尔排序](/basic/sorting/ShellSort/README.md)
8+
- [选择排序](/basic/sorting/SelectionSort/README.md)
9+
- [归并排序](/basic/sorting/MergeSort/README.md)
10+
- [快速排序](/basic/sorting/QuickSort/README.md)
11+
- [堆排序](/basic/sorting/HeapSort/README.md)
12+
- [计数排序](/basic/sorting/CountingSort/README.md)
1313

1414
## 查找算法
1515

16-
- [二分查找](/basic/searching/BinarySearch/README.md)
16+
- [二分查找](/basic/searching/BinarySearch/README.md)
1717

1818
## 版权
1919

basic/README_EN.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## Sorting
44

5-
- [Bubble Sort](/basic/sorting/BubbleSort/README.md)
6-
- [Insertion Sort](/basic/sorting/InsertionSort/README.md)
7-
- [Shell Sort](/basic/sorting/ShellSort/README.md)
8-
- [Selection Sort](/basic/sorting/SelectionSort/README.md)
9-
- [Merge Sort](/basic/sorting/MergeSort/README.md)
10-
- [Quick Sort](/basic/sorting/QuickSort/README.md)
11-
- [Heap Sort](/basic/sorting/HeapSort/README.md)
12-
- [Counting Sort](/basic/sorting/CountingSort/README.md)
5+
- [Bubble Sort](/basic/sorting/BubbleSort/README.md)
6+
- [Insertion Sort](/basic/sorting/InsertionSort/README.md)
7+
- [Shell Sort](/basic/sorting/ShellSort/README.md)
8+
- [Selection Sort](/basic/sorting/SelectionSort/README.md)
9+
- [Merge Sort](/basic/sorting/MergeSort/README.md)
10+
- [Quick Sort](/basic/sorting/QuickSort/README.md)
11+
- [Heap Sort](/basic/sorting/HeapSort/README.md)
12+
- [Counting Sort](/basic/sorting/CountingSort/README.md)
1313

1414
## Searching
1515

16-
- [Binary Search](/basic/searching/BinarySearch/README.md)
16+
- [Binary Search](/basic/searching/BinarySearch/README.md)
1717

1818
## Copyright
1919

basic/searching/BinarySearch/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ int search(int left, int right) {
5555

5656
## 例题
5757

58-
- [在排序数组中查找元素的第一个和最后一个位置](/solution/0000-0099/0034.Find%20First%20and%20Last%20Position%20of%20Element%20in%20Sorted%20Array/README.md)
59-
- [x 的平方根](/solution/0000-0099/0069.Sqrt%28x%29/README.md)
60-
- [寻找峰值](/solution/0100-0199/0162.Find%20Peak%20Element/README.md)
61-
- [第一个错误的版本](/solution/0200-0299/0278.First%20Bad%20Version/README.md)
62-
- [不动点](/solution/1000-1099/1064.Fixed%20Point/README.md)
58+
- [在排序数组中查找元素的第一个和最后一个位置](/solution/0000-0099/0034.Find%20First%20and%20Last%20Position%20of%20Element%20in%20Sorted%20Array/README.md)
59+
- [x 的平方根](/solution/0000-0099/0069.Sqrt%28x%29/README.md)
60+
- [寻找峰值](/solution/0100-0199/0162.Find%20Peak%20Element/README.md)
61+
- [第一个错误的版本](/solution/0200-0299/0278.First%20Bad%20Version/README.md)
62+
- [不动点](/solution/1000-1099/1064.Fixed%20Point/README.md)

basic/searching/BinarySearch/README_EN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Note that the advantage of these two templates is that they always keep the answ
5555

5656
## Examples
5757

58-
- [Find First and Last Position of Element in Sorted Array](/solution/0000-0099/0034.Find%20First%20and%20Last%20Position%20of%20Element%20in%20Sorted%20Array/README_EN.md)
59-
- [Sqrt(x)](/solution/0000-0099/0069.Sqrt%28x%29/README_EN.md)
60-
- [Find Peak Element](/solution/0100-0199/0162.Find%20Peak%20Element/README_EN.md)
61-
- [First Bad Version](/solution/0200-0299/0278.First%20Bad%20Version/README_EN.md)
62-
- [Fixed Point](/solution/1000-1099/1064.Fixed%20Point/README_EN.md)
58+
- [Find First and Last Position of Element in Sorted Array](/solution/0000-0099/0034.Find%20First%20and%20Last%20Position%20of%20Element%20in%20Sorted%20Array/README_EN.md)
59+
- [Sqrt(x)](/solution/0000-0099/0069.Sqrt%28x%29/README_EN.md)
60+
- [Find Peak Element](/solution/0100-0199/0162.Find%20Peak%20Element/README_EN.md)
61+
- [First Bad Version](/solution/0200-0299/0278.First%20Bad%20Version/README_EN.md)
62+
- [Fixed Point](/solution/1000-1099/1064.Fixed%20Point/README_EN.md)

basic/sorting/CountingSort/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
算法描述:
66

7-
- 给定原数组中元素值的范围 `[min, max]`
8-
- 创建一个新数组 `c` ,其长度是 `max-min+1`,其元素默认值都是 `0`
9-
- 遍历原数组中的元素,以原数组中的元素作为 `c` 数组的索引,以原数组中的元素出现次数作为 `c` 数组的元素值。
10-
- 创建结果数组 `r`,起始索引 `i`
11-
- 遍历数组 `c`,找出其中元素大于 `0` 的元素,将其对应的索引作为元素值填充到 `r` 数组中,每处理一次,`c` 中的元素值减 `1`,直到该元素值不大于 `0`,依次处理 `c` 中剩下的元素
7+
- 给定原数组中元素值的范围 `[min, max]`
8+
- 创建一个新数组 `c` ,其长度是 `max-min+1`,其元素默认值都是 `0`
9+
- 遍历原数组中的元素,以原数组中的元素作为 `c` 数组的索引,以原数组中的元素出现次数作为 `c` 数组的元素值。
10+
- 创建结果数组 `r`,起始索引 `i`
11+
- 遍历数组 `c`,找出其中元素大于 `0` 的元素,将其对应的索引作为元素值填充到 `r` 数组中,每处理一次,`c` 中的元素值减 `1`,直到该元素值不大于 `0`,依次处理 `c` 中剩下的元素
1212

1313
## 算法分析
1414

15-
- 时间复杂度 $O(n+k)$, 其中 $n$ 为排序数组长度,而 $k$ 为排序数组中数值的取值范围,当 $k\lt n$ 时,时间复杂度为 $O(n)$。
16-
- 空间复杂度 $O(n+k)$, 其中 $n$ 为排序数组长度,而 $k$ 为排序数组中数值的取值范围,当 $k\lt n$ 时,空间复杂度为 $O(n)$。
15+
- 时间复杂度 $O(n+k)$, 其中 $n$ 为排序数组长度,而 $k$ 为排序数组中数值的取值范围,当 $k\lt n$ 时,时间复杂度为 $O(n)$。
16+
- 空间复杂度 $O(n+k)$, 其中 $n$ 为排序数组长度,而 $k$ 为排序数组中数值的取值范围,当 $k\lt n$ 时,空间复杂度为 $O(n)$。

basic/sorting/HeapSort/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ for (int i = n / 2; i > 0; --i) {
5151

5252
**数据范围**
5353

54-
- 1 ≤ m ≤ n ≤ 10^5
55-
- 1 ≤ 数列中元素 ≤ 10^9
54+
- 1 ≤ m ≤ n ≤ 10^5
55+
- 1 ≤ 数列中元素 ≤ 10^9
5656

5757
**输入样例:**
5858

basic/sorting/InsertionSort/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
与冒泡排序对比:
1212

13-
- 在冒泡排序中,经过每一轮的排序处理后,数组后端的数是排好序的。
14-
- 在插入排序中,经过每一轮的排序处理后,数组前端的数是排好序的。
13+
- 在冒泡排序中,经过每一轮的排序处理后,数组后端的数是排好序的。
14+
- 在插入排序中,经过每一轮的排序处理后,数组前端的数是排好序的。
1515

1616
## 代码示例
1717

0 commit comments

Comments
 (0)