Skip to content

Commit 623c46b

Browse files
authored
Merge branch 'doocs:main' into main
2 parents fe78bba + 1da0998 commit 623c46b

File tree

7,540 files changed

+227028
-52242
lines changed

Some content is hidden

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

7,540 files changed

+227028
-52242
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
- docs
87
paths:
9-
- package.json
10-
- requirements.txt
118
- solution/**
129
- lcs/**
1310
- lcp/**

basic/sorting/BubbleSort/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<!-- tabs:start -->
1010

11+
#### Python3
12+
1113
```python
1214
def bubbleSort(arr):
1315
n = len(arr)
@@ -37,6 +39,8 @@ bubbleSort(arr)
3739
print(arr)
3840
```
3941

42+
#### Java
43+
4044
```java
4145
import java.util.Arrays;
4246

@@ -69,6 +73,8 @@ public class BubbleSort {
6973
}
7074
```
7175

76+
#### C++
77+
7278
```cpp
7379
#include <iostream>
7480
#include <vector>
@@ -97,6 +103,8 @@ int main() {
97103
}
98104
```
99105
106+
#### Go
107+
100108
```go
101109
package main
102110
@@ -122,6 +130,8 @@ func main() {
122130
}
123131
```
124132

133+
#### Rust
134+
125135
```rust
126136
fn bubble_sort(nums: &mut Vec<i32>) {
127137
let n = nums.len();
@@ -143,6 +153,8 @@ fn main() {
143153
}
144154
```
145155

156+
#### JavaScript
157+
146158
```js
147159
function bubbleSort(inputArr) {
148160
for (let i = inputArr.length - 1; i > 0; i--) {
@@ -168,6 +180,8 @@ const arr = [6, 3, 2, 1, 5];
168180
console.log(bubbleSort(arr));
169181
```
170182

183+
#### C#
184+
171185
```cs
172186
using static System.Console;
173187
namespace Pro;
@@ -217,5 +231,3 @@ public class Program
217231
```
218232

219233
<!-- tabs:end -->
220-
221-
<!-- end -->

basic/sorting/HeapSort/README.md

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

7272
<!-- tabs:start -->
7373

74-
### **Python3**
74+
#### Python3
7575

7676
```python
7777
n, m = list(map(int, input().split(" ")))
@@ -110,7 +110,7 @@ for i in range(m):
110110
print(' '.join(list(map(str, res))))
111111
```
112112

113-
### **Java**
113+
#### Java
114114

115115
```java
116116
import java.util.Scanner;
@@ -165,7 +165,7 @@ public class Main {
165165
}
166166
```
167167

168-
### **Rust**
168+
#### Rust
169169

170170
```rust
171171
use std::io;
@@ -230,7 +230,7 @@ fn main() -> io::Result<()> {
230230
}
231231
```
232232

233-
### **Go**
233+
#### Go
234234

235235
```go
236236
package main
@@ -286,12 +286,16 @@ func main() {
286286
}
287287
```
288288

289-
<!-- tabs:end -->## 解法
289+
<!-- tabs:end -->
290+
291+
## 解法
290292

291293
### 方法一
292294

293295
<!-- tabs:start -->
294296

297+
#### Python3
298+
295299
```python
296300
n, m = list(map(int, input().split(" ")))
297301
h = [0] + list(map(int, input().split(" ")))
@@ -329,6 +333,8 @@ for i in range(m):
329333
print(' '.join(list(map(str, res))))
330334
```
331335

336+
#### Java
337+
332338
```java
333339
import java.util.Scanner;
334340

@@ -382,6 +388,8 @@ public class Main {
382388
}
383389
```
384390

391+
#### Go
392+
385393
```go
386394
package main
387395

@@ -436,6 +444,8 @@ func main() {
436444
}
437445
```
438446

447+
#### Rust
448+
439449
```rust
440450
use std::io;
441451

@@ -500,5 +510,3 @@ fn main() -> io::Result<()> {
500510
```
501511

502512
<!-- tabs:end -->
503-
504-
<!-- end -->

basic/sorting/InsertionSort/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
<!-- tabs:start -->
1919

20+
#### Python3
21+
2022
```python
2123
def insertion_sort(array):
2224
for i in range(len(array)):
@@ -34,6 +36,8 @@ array = [10, 17, 50, 7, 30, 24, 27, 45, 15, 5, 36, 21]
3436
print(insertion_sort(array))
3537
```
3638

39+
#### Java
40+
3741
```java
3842
import java.util.Arrays;
3943

@@ -57,6 +61,8 @@ public class InsertionSort {
5761
}
5862
```
5963

64+
#### C++
65+
6066
```cpp
6167
#include <iostream>
6268
#include <vector>
@@ -96,6 +102,8 @@ int main() {
96102
}
97103
```
98104
105+
#### Go
106+
99107
```go
100108
package main
101109
@@ -118,6 +126,8 @@ func main() {
118126
}
119127
```
120128

129+
#### Rust
130+
121131
```rust
122132
fn insertion_sort(nums: &mut Vec<i32>) {
123133
let n = nums.len();
@@ -139,6 +149,8 @@ fn main() {
139149
}
140150
```
141151

152+
#### JavaScript
153+
142154
```js
143155
function insertionSort(inputArr) {
144156
let len = inputArr.length;
@@ -158,6 +170,8 @@ let arr = [6, 3, 2, 1, 5];
158170
console.log(insertionSort(arr));
159171
```
160172

173+
#### C#
174+
161175
```cs
162176
using System.Diagnostics;
163177
using static System.Console;
@@ -197,5 +211,3 @@ public class Program
197211
```
198212

199213
<!-- tabs:end -->
200-
201-
<!-- end -->

basic/sorting/MergeSort/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ void mergeSort(int[] nums, int left, int right) {
7373

7474
<!-- tabs:start -->
7575

76+
#### Python3
77+
7678
```python
7779
N = int(input())
7880
nums = list(map(int, input().split()))
@@ -110,6 +112,8 @@ merge_sort(nums, 0, N - 1)
110112
print(' '.join(list(map(str, nums))))
111113
```
112114

115+
#### Java
116+
113117
```java
114118
import java.util.Scanner;
115119

@@ -157,6 +161,8 @@ public class Main {
157161
}
158162
```
159163

164+
#### C++
165+
160166
```cpp
161167
#include <iostream>
162168

@@ -194,6 +200,8 @@ int main() {
194200
}
195201
```
196202
203+
#### Go
204+
197205
```go
198206
package main
199207
@@ -246,6 +254,8 @@ func main() {
246254
}
247255
```
248256

257+
#### Rust
258+
249259
```rust
250260
use std::io;
251261

@@ -306,6 +316,8 @@ fn main() -> io::Result<()> {
306316
}
307317
```
308318

319+
#### JavaScript
320+
309321
```js
310322
var buf = '';
311323

@@ -362,5 +374,3 @@ process.stdin.on('end', function () {
362374
```
363375

364376
<!-- tabs:end -->
365-
366-
<!-- end -->

basic/sorting/QuickSort/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ void quickSort(int[] nums, int left, int right) {
6666

6767
<!-- tabs:start -->
6868

69+
#### Python3
70+
6971
```python
7072
N = int(input())
7173
nums = list(map(int, input().split()))
@@ -95,6 +97,8 @@ quick_sort(nums, 0, N - 1)
9597
print(' '.join(list(map(str, nums))))
9698
```
9799

100+
#### Java
101+
98102
```java
99103
import java.util.Scanner;
100104

@@ -135,6 +139,8 @@ public class Main {
135139
}
136140
```
137141

142+
#### C++
143+
138144
```cpp
139145
#include <iostream>
140146

@@ -169,6 +175,8 @@ int main() {
169175
}
170176
```
171177
178+
#### Go
179+
172180
```go
173181
package main
174182
@@ -217,6 +225,8 @@ func main() {
217225
}
218226
```
219227

228+
#### Rust
229+
220230
```rust
221231
use rand::Rng; // 0.7.2
222232
use std::io;
@@ -271,6 +281,8 @@ fn main() -> io::Result<()> {
271281
}
272282
```
273283

284+
#### JavaScript
285+
274286
```js
275287
var buf = '';
276288

@@ -319,5 +331,3 @@ process.stdin.on('end', function () {
319331
```
320332

321333
<!-- tabs:end -->
322-
323-
<!-- end -->

0 commit comments

Comments
 (0)