mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-10-29 22:17:23 +01:00
feat(challenges): add sorting-algorithms
This commit is contained in:
parent
0e6bca44b2
commit
62c078d9a1
18
challenges/sorting-algorithms/README.md
Normal file
18
challenges/sorting-algorithms/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# sorting-algorithms
|
||||
|
||||
Created by [@Divlo](https://github.com/Divlo) on 29 June 2021.
|
||||
|
||||
## Instructions
|
||||
|
||||
In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order.
|
||||
We will use the [numerical order](https://en.wikipedia.org/wiki/Numerical_order).
|
||||
|
||||
Write a function that takes a list of integers and sort them in ascending order.
|
||||
|
||||
## Source
|
||||
|
||||
- [Wikipedia - Sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm)
|
||||
|
||||
## Examples
|
||||
|
||||
See the `test` folder for examples of input/output.
|
0
challenges/sorting-algorithms/solutions/.gitkeep
Normal file
0
challenges/sorting-algorithms/solutions/.gitkeep
Normal file
1
challenges/sorting-algorithms/test/1/input.txt
Normal file
1
challenges/sorting-algorithms/test/1/input.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
challenges/sorting-algorithms/test/1/output.txt
Normal file
1
challenges/sorting-algorithms/test/1/output.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
10
challenges/sorting-algorithms/test/2/input.txt
Normal file
10
challenges/sorting-algorithms/test/2/input.txt
Normal file
@ -0,0 +1,10 @@
|
||||
1
|
||||
2
|
||||
5
|
||||
1
|
||||
5
|
||||
10
|
||||
9
|
||||
3
|
||||
6
|
||||
2
|
10
challenges/sorting-algorithms/test/2/output.txt
Normal file
10
challenges/sorting-algorithms/test/2/output.txt
Normal file
@ -0,0 +1,10 @@
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
5
|
||||
5
|
||||
6
|
||||
9
|
||||
10
|
100
challenges/sorting-algorithms/test/3/input.txt
Normal file
100
challenges/sorting-algorithms/test/3/input.txt
Normal file
@ -0,0 +1,100 @@
|
||||
86
|
||||
100
|
||||
98
|
||||
1
|
||||
84
|
||||
71
|
||||
48
|
||||
83
|
||||
6
|
||||
35
|
||||
12
|
||||
1
|
||||
14
|
||||
33
|
||||
32
|
||||
46
|
||||
80
|
||||
15
|
||||
44
|
||||
8
|
||||
33
|
||||
77
|
||||
75
|
||||
76
|
||||
66
|
||||
65
|
||||
8
|
||||
90
|
||||
51
|
||||
26
|
||||
9
|
||||
54
|
||||
50
|
||||
91
|
||||
96
|
||||
37
|
||||
98
|
||||
66
|
||||
33
|
||||
50
|
||||
94
|
||||
92
|
||||
36
|
||||
41
|
||||
62
|
||||
68
|
||||
98
|
||||
21
|
||||
76
|
||||
17
|
||||
13
|
||||
18
|
||||
22
|
||||
1
|
||||
37
|
||||
91
|
||||
19
|
||||
35
|
||||
65
|
||||
19
|
||||
68
|
||||
55
|
||||
66
|
||||
26
|
||||
58
|
||||
79
|
||||
11
|
||||
62
|
||||
16
|
||||
8
|
||||
64
|
||||
47
|
||||
23
|
||||
72
|
||||
43
|
||||
87
|
||||
46
|
||||
36
|
||||
35
|
||||
40
|
||||
8
|
||||
67
|
||||
44
|
||||
41
|
||||
10
|
||||
92
|
||||
36
|
||||
95
|
||||
79
|
||||
85
|
||||
78
|
||||
66
|
||||
3
|
||||
31
|
||||
80
|
||||
74
|
||||
33
|
||||
25
|
||||
59
|
||||
50
|
100
challenges/sorting-algorithms/test/3/output.txt
Normal file
100
challenges/sorting-algorithms/test/3/output.txt
Normal file
@ -0,0 +1,100 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
3
|
||||
6
|
||||
8
|
||||
8
|
||||
8
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
19
|
||||
21
|
||||
22
|
||||
23
|
||||
25
|
||||
26
|
||||
26
|
||||
31
|
||||
32
|
||||
33
|
||||
33
|
||||
33
|
||||
33
|
||||
35
|
||||
35
|
||||
35
|
||||
36
|
||||
36
|
||||
36
|
||||
37
|
||||
37
|
||||
40
|
||||
41
|
||||
41
|
||||
43
|
||||
44
|
||||
44
|
||||
46
|
||||
46
|
||||
47
|
||||
48
|
||||
50
|
||||
50
|
||||
50
|
||||
51
|
||||
54
|
||||
55
|
||||
58
|
||||
59
|
||||
62
|
||||
62
|
||||
64
|
||||
65
|
||||
65
|
||||
66
|
||||
66
|
||||
66
|
||||
66
|
||||
67
|
||||
68
|
||||
68
|
||||
71
|
||||
72
|
||||
74
|
||||
75
|
||||
76
|
||||
76
|
||||
77
|
||||
78
|
||||
79
|
||||
79
|
||||
80
|
||||
80
|
||||
83
|
||||
84
|
||||
85
|
||||
86
|
||||
87
|
||||
90
|
||||
91
|
||||
91
|
||||
92
|
||||
92
|
||||
94
|
||||
95
|
||||
96
|
||||
98
|
||||
98
|
||||
98
|
||||
100
|
1000
challenges/sorting-algorithms/test/4/input.txt
Normal file
1000
challenges/sorting-algorithms/test/4/input.txt
Normal file
File diff suppressed because it is too large
Load Diff
1000
challenges/sorting-algorithms/test/4/output.txt
Normal file
1000
challenges/sorting-algorithms/test/4/output.txt
Normal file
File diff suppressed because it is too large
Load Diff
25000
challenges/sorting-algorithms/test/5/input.txt
Normal file
25000
challenges/sorting-algorithms/test/5/input.txt
Normal file
File diff suppressed because it is too large
Load Diff
25000
challenges/sorting-algorithms/test/5/output.txt
Normal file
25000
challenges/sorting-algorithms/test/5/output.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user