Skip to content

Commit 60ec76a

Browse files
authored
Replace RadixSort with CombSort in README.md (#65)
1 parent 7179745 commit 60ec76a

File tree

1 file changed

+5
-50
lines changed

1 file changed

+5
-50
lines changed

README.md

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
77

88
- [HeapSort] – an unstable, general purpose, in-place, O(n log n) comparison sort that works by heapifying an array and repeatedly taking the maximal element from the heap.
99
- [TimSort] – a stable, general purpose, hybrid, O(n log n) comparison sort that adapts to different common patterns of partially ordered input data.
10-
- [RadixSort] – a stable, special case, O(n) non-comparison sort that works by sorting data with fixed size, one digit at a time.
10+
- [CombSort] – an unstable, general purpose, in-place, O(n log n) comparison sort with O(n^2) pathological cases that is very efficient for primitieve types and orders due to SIMD instructions and instruction level paralellism on modern hardware.
1111

12-
[HeapSort]: http://en.wikipedia.org/wiki/Heapsort
13-
[TimSort]: http://en.wikipedia.org/wiki/Timsort
14-
[RadixSort]: http://en.wikipedia.org/wiki/Radix_sort
12+
[HeapSort]: https://en.wikipedia.org/wiki/Heapsort
13+
[TimSort]: https://en.wikipedia.org/wiki/Timsort
14+
[CombSort]: https://en.wikipedia.org/wiki/Comb_sort
1515

1616
## Usage
1717

@@ -23,11 +23,7 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
2323
"A"
2424
"a"
2525
"aa"
26-
"aal"
27-
"aalii"
2826
29-
"zythem"
30-
"Zythia"
3127
"zythum"
3228
"Zyzomys"
3329
"Zyzzogeton"
@@ -37,11 +33,7 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
3733
"A"
3834
"Aani"
3935
"Aaron"
40-
"Aaronic"
41-
"Aaronical"
4236
43-
"zymotize"
44-
"zymotoxic"
4537
"zymurgy"
4638
"zythem"
4739
"zythum"
@@ -51,11 +43,7 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
5143
"A"
5244
"B"
5345
"C"
54-
"D"
55-
"E"
5646
57-
"formaldehydesulphoxylate"
58-
"pathologicopsychological"
5947
"scientificophilosophical"
6048
"tetraiodophenolphthalein"
6149
"thyroparathyroidectomize"
@@ -65,11 +53,7 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
6553
"A"
6654
"Aani"
6755
"Aaron"
68-
"Aaronic"
69-
"Aaronical"
7056
71-
"zymotize"
72-
"zymotoxic"
7357
"zymurgy"
7458
"zythem"
7559
"zythum"
@@ -79,46 +63,17 @@ The `SortingAlgorithms` package provides three sorting algorithms that can be us
7963
"L"
8064
"p"
8165
"U"
82-
"I"
83-
"q"
8466
85-
"pathologicopsychological"
86-
"formaldehydesulphoxylate"
8767
"scientificophilosophical"
8868
"tetraiodophenolphthalein"
8969
"thyroparathyroidectomize"
9070

91-
julia> sort!(words, alg=RadixSort)
92-
ERROR: Radix sort only sorts bits types (got ASCIIString)
93-
in error at error.jl:21
94-
in sort! at /Users/stefan/.julia/SortingAlgorithms/src/SortingAlgorithms.jl:54
95-
in sort! at sort.jl:328
96-
in sort! at sort.jl:329
97-
98-
julia> floats = randn(1000)
99-
1000-element Array{Float64,1}:
100-
1.729
101-
0.907196
102-
0.461481
103-
-0.204763
104-
-0.16022
105-
106-
0.700683
107-
-0.236204
108-
-2.15634
109-
-0.316188
110-
-0.171478
111-
112-
julia> sort!(floats, alg=RadixSort)
71+
julia> sort!(randn(1000), alg=CombSort)
11372
1000-element Array{Float64,1}:
11473
-2.86255
11574
-2.72041
11675
-2.58234
117-
-2.57259
118-
-2.53046
11976
120-
3.08307
121-
3.12902
12277
3.15075
12378
3.20058
12479
3.23942

0 commit comments

Comments
 (0)