Slowsort

Trait Slowsort 

Source
pub trait Slowsort<T: PartialEq + PartialOrd + Clone + Copy> {
    // Required methods
    fn slowsort(&mut self);
    fn slowsort_timed(&mut self) -> Duration;
    fn slowsort_stepped(&mut self) -> Vec<Vec<T>>;
    fn slowsort_stepped_and_timed(&mut self) -> (Vec<Vec<T>>, Duration);
}
Expand description

A trait providing the slowsort algorithm.

Required Methods§

Source

fn slowsort(&mut self)

The slowsort algorithm.

Sorts the Vec it is called on.

Source

fn slowsort_timed(&mut self) -> Duration

The slowsort algorithm but timed.

Sorts the Vec it is called on and returns the Duration of the process.

Source

fn slowsort_stepped(&mut self) -> Vec<Vec<T>>

The slowsort algorithm but stepped.

Sorts the Vec it is called on and returns a Vec containing each step of the process.

Source

fn slowsort_stepped_and_timed(&mut self) -> (Vec<Vec<T>>, Duration)

The slowsort algorithm but stepped and timed.

Sorts the Vec it is called on and returns a Vec containing each step of the process, including the Duration of the entire process.

Implementations on Foreign Types§

Source§

impl<T> Slowsort<T> for Vec<T>
where T: PartialEq + PartialOrd + Clone + Copy,

The trait implementation of the slowsort algorithm.

Implementors§