Crate sorting [−] [src]
This crate provides an implementation of various quality sorting methods. Only the most useless or inefficient sorting algorithms are implemented. You may use them in your production application, altough I would strongly advise against that. Currently, the following sorting algorithms are implemented:
Panicsort
This sorting method kind of follows the principle of check and surrender and simply panics when the array or vector is not sorted:
let unsorted = vec![5, 7, 8, 2, 1, 0]; unsorted.panicsort(); // will panic
Slowsort
This sorting algorithm recursively sorts the input array by finding the maximum of the sorted array, placing that maximum at the end and sorting the remaining array.
let mut unsorted = vec![5, 7, 8, 2, 1, 0]; unsorted.slowsort();
Bogosort
This highly inefficient algorithm scrambles the input vector until it is sorted. Depending on your luck and the length of the input vector this might never return.
let mut unsorted = vec![5, 7, 8, 2, 1, 0]; unsorted.bogosort(); // might take a while...
Traits
Bogosort |
This trait provides the |
Panicsort |
This trait provides the |
Slowsort |
This trait provides the |