Skip to content

Commit 43ae4a0

Browse files
authored
Merge branch 'doocs:main' into main
2 parents dbd39ab + f1aee3d commit 43ae4a0

File tree

7,241 files changed

+299332
-57123
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,241 files changed

+299332
-57123
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ node_modules/
2323
/solution/2200-2299/2205.The Number of Users That Are Eligible for Discount/Solution.sql
2424
/solution/2200-2299/2230.The Users That Are Eligible for Discount/Solution.sql
2525
/solution/2200-2299/2252.Dynamic Pivoting of a Table/Solution.sql
26-
/solution/2200-2299/2253.Dynamic Unpivoting of a Table/Solution.sql
26+
/solution/2200-2299/2253.Dynamic Unpivoting of a Table/Solution.sql
27+
/solution/3100-3199/3150.Invalid Tweets II/Solution.sql

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: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ for (int i = n / 2; i > 0; --i) {
7373

7474
### **Python3**
7575

76+
#### Python3
77+
7678
```python
7779
n, m = list(map(int, input().split(" ")))
7880
h = [0] + list(map(int, input().split(" ")))
@@ -112,6 +114,8 @@ print(' '.join(list(map(str, res))))
112114

113115
### **Java**
114116

117+
#### Java
118+
115119
```java
116120
import java.util.Scanner;
117121

@@ -167,6 +171,8 @@ public class Main {
167171

168172
### **Rust**
169173

174+
#### Rust
175+
170176
```rust
171177
use std::io;
172178

@@ -232,6 +238,8 @@ fn main() -> io::Result<()> {
232238

233239
### **Go**
234240

241+
#### Go
242+
235243
```go
236244
package main
237245

@@ -286,12 +294,16 @@ func main() {
286294
}
287295
```
288296

289-
<!-- tabs:end -->## 解法
297+
<!-- tabs:end -->
298+
299+
## 解法
290300

291301
### 方法一
292302

293303
<!-- tabs:start -->
294304

305+
#### Python3
306+
295307
```python
296308
n, m = list(map(int, input().split(" ")))
297309
h = [0] + list(map(int, input().split(" ")))
@@ -329,6 +341,8 @@ for i in range(m):
329341
print(' '.join(list(map(str, res))))
330342
```
331343

344+
#### Java
345+
332346
```java
333347
import java.util.Scanner;
334348

@@ -382,6 +396,8 @@ public class Main {
382396
}
383397
```
384398

399+
#### Go
400+
385401
```go
386402
package main
387403

@@ -436,6 +452,8 @@ func main() {
436452
}
437453
```
438454

455+
#### Rust
456+
439457
```rust
440458
use std::io;
441459

@@ -500,5 +518,3 @@ fn main() -> io::Result<()> {
500518
```
501519

502520
<!-- 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)