Trait sort_it::algorithms::gnome_sort::GnomeSort
source · [−]pub trait GnomeSort<T: PartialEq + PartialOrd + Clone + Copy> {
fn gnome_sort(&mut self);
fn gnome_sort_timed(&mut self) -> Duration;
fn gnome_sort_stepped(&mut self) -> Vec<Vec<T>>;
fn gnome_sort_stepped_and_timed(&mut self) -> (Vec<Vec<T>>, Duration);
}
Expand description
A trait providing the gnome sort method.
Required methods
fn gnome_sort(&mut self)
fn gnome_sort(&mut self)
The gnome sort algorithm.
Sorts the Vec
it is called on.
fn gnome_sort_timed(&mut self) -> Duration
fn gnome_sort_timed(&mut self) -> Duration
The gnome sort algorithm but timed.
Sorts the Vec
it is called on and returns the Duration
of the process.
fn gnome_sort_stepped(&mut self) -> Vec<Vec<T>>
fn gnome_sort_stepped(&mut self) -> Vec<Vec<T>>
The gnome sort algorithm but stepped.
Sorts the Vec
it is called on and returns a Vec
containing each step of the process.
Implementations on Foreign Types
sourceimpl<T> GnomeSort<T> for Vec<T> where
T: PartialEq + PartialOrd + Clone + Copy,
impl<T> GnomeSort<T> for Vec<T> where
T: PartialEq + PartialOrd + Clone + Copy,
The trait implementation of the bogosort algorithm.