Trait sort_it::algorithms::stooge_sort::StoogeSort
source · [−]pub trait StoogeSort<T: PartialEq + PartialOrd + Clone + Copy> {
fn stooge_sort(&mut self);
fn stooge_sort_timed(&mut self) -> Duration;
fn stooge_sort_stepped(&mut self) -> Vec<Vec<T>>;
fn stooge_sort_stepped_and_timed(&mut self) -> (Vec<Vec<T>>, Duration);
}
Expand description
A trait providing the stooge sort algorithm.
Required methods
fn stooge_sort(&mut self)
fn stooge_sort(&mut self)
The stooge sort algorithm.
Sorts the Vec
it is called on.
fn stooge_sort_timed(&mut self) -> Duration
fn stooge_sort_timed(&mut self) -> Duration
The stooge sort algorithm but timed.
Sorts the Vec
it is called on and returns the Duration
of the process.
fn stooge_sort_stepped(&mut self) -> Vec<Vec<T>>
fn stooge_sort_stepped(&mut self) -> Vec<Vec<T>>
The stooge sort algorithm but stepped.
Sorts the Vec
it is called on and returns a Vec
containing each step of the process.