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