pub fn double_sort<T: Copy + Ord>(array: &mut Vec<T>)
Expand description

Sorts a vector of elements by pairing them and ordering them by the lowest number, then exchanging elements with neighbours until sorted.

Example

use double_sort::double_sort;
fn main() {
    let mut vector = vec![48,23,78,67,89,22,33,44];
  
    double_sort(&mut vector);
 
    assert_eq!(vector,[22,23,33,44,48,67,78,89]);
}