Trait sort_it::algorithms::selection_sort::SelectionSort
source · [−]pub trait SelectionSort<T: PartialEq + PartialOrd + Clone + Copy> {
fn selection_sort(&mut self);
fn selection_sort_timed(&mut self) -> Duration;
fn selection_sort_stepped(&mut self) -> Vec<(Vec<T>, Vec<T>)>;
fn selection_sort_stepped_and_timed(
&mut self
) -> (Vec<(Vec<T>, Vec<T>)>, Duration);
}
Expand description
A trait providing the selection sort algorithm.
Required methods
fn selection_sort(&mut self)
fn selection_sort(&mut self)
The selection sort algorithm.
Sorts the Vec
it is called on.
fn selection_sort_timed(&mut self) -> Duration
fn selection_sort_timed(&mut self) -> Duration
The selection sort algorithm but timed.
Sorts the Vec
it is called on and returns the Duration
of the process.
The selection 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> SelectionSort<T> for Vec<T> where
T: PartialEq + PartialOrd + Clone + Copy,
impl<T> SelectionSort<T> for Vec<T> where
T: PartialEq + PartialOrd + Clone + Copy,
The trait implementation of the selection sort algorithm.