You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+4-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@
14
14
//! | Merge | independent of data distribution | `nlogn` | `nlogn` or `n` | `n` |
15
15
//! | Odd-even | presented to be effective on processors with local interconnections | `n`<sup>`2`</sup> | `n` | `1` |
16
16
//! | Odd-even (Batcher) | more efficient version of odd-even sort | `log`<sup>`2`</sup>`n` | `log`<sup>`2`</sup>`n` | `log`<sup>`2`</sup>`n` |
17
-
//! | Quick | bad for sorted or reversed input | `n`<sup>`2`</sup> | `n` | `n` or `logn` |
17
+
//! | Quick | bad for sorted or reversed input | `n`<sup>`2`</sup> | `nlog`<sub>2</sub>`n` | `n` or `logn` |
18
+
//! | Ksort | modified version of quicksort, faster than heap at less than 7 million elements | `n`<sup>`2`</sup> | `nlog`<sub>2</sub>`n` | `n` or `logn` |
18
19
//! | Selection | the least number of swaps among all the algorithms | `n`<sup>`2`</sup>; `n` | `n`<sup>`2`</sup>; `1` | `1` |
19
20
//! | Shell | it is optimization of insertion sort | `n`<sup>`2`</sup> or `nlog`<sup>`2`</sup>`n` | `nlogn` or `nlog`<sup>`2`</sup>`n` | `n` |
20
21
//! | Slow | it's slow, who would ever need it? | | | |
@@ -27,6 +28,7 @@ pub mod comb_sort;
27
28
pubmod gnome_sort;
28
29
pubmod heap_sort;
29
30
pubmod insertion_sort;
31
+
pubmod ksort;
30
32
pubmod merge_sort;
31
33
pubmod nheap_sort;
32
34
pubmod oddeven_sort;
@@ -44,6 +46,7 @@ pub use self::gnome_sort::gnome_sort;
0 commit comments