[][src]Crate sorting_rs

This library contains following sorting algorithms:

Sorting algorithmFeatures and downsidesWorst-case performance O(): comparisons; swapsBest-case performance O(): comparisons; swapsSpace complexity O()
Bubblebad for sorted or reversed inputn2; n2n; 1n or 1
Cocktaillittle performance improvement over bubble sortn2n1
Combspeeds up when data is nearly sortedn2nlogn1
Gnomesimple and slow, works with one item at a timen2n1
Heapindependent of data distributionnlognnlogn or nn or 1
Weak Heapindependent of data distribution, decreased amount of comparisonsnlognnlogn or nn or 1
N-Heapindependent of data distribution, should be faster than default heap. n = 3nlognnlogn or nn or 1
Bottom-up Heapupgraded version of heapsort with decreased number of comparisonsnlognnlogn or nn or 1
Insertionsimple, but less effective than quicksort, heapsort or merge sortn2; n2n; 1n or 1
Mergeindependent of data distributionnlognnlognn
Odd-evenpresented to be effective on processors with local interconnectionsn2n1
Odd-even (Batcher)more efficient version of odd-even sortnlogn2logn2logn2
Quickbad for sorted or reversed inputn2nlog2nn or logn
Quick dualenchanced version of quicksortn22nlnnn or logn
Ksortmodified version of quicksort, faster than heap at less than 7 million elementsn2nlog2nn or logn
Selectionthe least number of swaps among all the algorithmsn2; nn2; 11
Double selectionmodified version of selection sort with more workload, but better efficiencyn2; nn2; 1more than Selection
Shellsortit is optimization of insertion sortn3/2 or nlog2nnlogn1
Slowit's slow, who would ever need it?
Smoothvariant of heapsort, good for nearly sorted datanlognnn or 1
Stoogeit's a bit faster than slow sortn2.7095n

Re-exports

pub use self::bubble_sort::bubble_sort;
pub use self::cocktail_sort::cocktail_sort;
pub use self::comb_sort::comb_sort;
pub use self::gnome_sort::gnome_sort;
pub use self::heap_sort::heap_sort;
pub use self::heap_sort::heap_bottom_up_sort;
pub use self::heap_sort::weak_heap_sort;
pub use self::nheap_sort::nheap_sort;
pub use self::insertion_sort::insertion_sort;
pub use self::ksort::ksort;
pub use self::merge_sort::merge_sort;
pub use self::oddeven_sort::oddeven_sort;
pub use self::oddeven_sort::oddeven_batcher_sort;
pub use self::quick_sort::quick_sort;
pub use self::quick_sort::quick_dual_sort;
pub use self::selection_sort::selection_sort;
pub use self::selection_sort::selection_double_sort;
pub use self::shell_sort::shell_sort;
pub use self::slow_sort::slow_sort;
pub use self::smooth_sort::smooth_sort;
pub use self::stooge_sort::stooge_sort;

Modules

bubble_sort
cocktail_sort
comb_sort
gnome_sort
heap_sort
insertion_sort
ksort
merge_sort
nheap_sort
oddeven_sort
quick_sort
selection_sort
shell_sort
slow_sort
smooth_sort
stooge_sort