[][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()
Bingoaims to be faster than selection sort if there are duplicatesn + m2nm
Bitonicmethod based on building a sorting networknlog2nnlog2nnlog2n
Bubblebad for sorted or reversed inputn2; n2n; 11
Cocktaillittle performance improvement over bubble sortn2n1
Combspeeds up when data is nearly sortedn2nlogn1
Cycleuses minimum amount of writes, good for memory with limited TBWn2n21
Gnomesimple and slow, works with one item at a timen2n1
Heapindependent of data distributionnlognnlogn1
Weak Heapindependent of data distribution, decreased number of comparisonsnlognnlogn1
N-Heapshould be faster than default heap. N = 3nlognnlogn1
Bottom-up Heapupgraded version of heapsort with decreased number of comparisonsnlognnlogn1
Insertionsimple, but less effective than quicksort, heapsort or merge sortn2; n2n; 11
Mergeindependent of data distributionnlognnlognn
Odd-evenpresented to be effective on processors with local interconnectionsn2n1
Odd-even Batchermore efficient version of odd-even sortlog2nlog2nlogn2
Pancakeswaps data a lot and not so effective in practicen3; 2n - 3n2n
Quickbad for sorted or reversed inputn2nlognlogn
Quick dualenchanced version of quicksortn22nlnnlogn
Ksortquicksort variant, faster than heap at less than 7 million elementsn2nlog2nlogn
Selectionthe least number of swaps among all the algorithmsn2; nn2; 11
Double selectionmodified selection sort with more workload, but better efficiencyn2; nn2; 1higher than Selection
Shellsortit is optimization of insertion sortn3/2 or nlogn2nlogn1
Slowit's slow, who would ever need it?
Smoothvariant of heapsort, good for nearly sorted datanlognn1
Stoogeit's a bit faster than slow sortn2.7095n

Re-exports

pub use self::bingo_sort::bingo_sort;
pub use self::bitonic_sort::bitonic_sort;
pub use self::bubble_sort::bubble_sort;
pub use self::cocktail_sort::cocktail_sort;
pub use self::comb_sort::comb_sort;
pub use self::cycle_sort::cycle_sort;
pub use self::gnome_sort::gnome_sort;
pub use self::gnome_sort::gnome_up_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::pancake_sort::pancake_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

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