rust-sort
sort algorithms
exchange sorts
bubble sort
extern crate sort;
use bubble_sort;
selection sorts
selection sort
extern crate sort;
use selection_sort;
sort algorithms
extern crate sort;
use sort::bubble_sort;
fn main() {
let mut data = vec![5, 4, 3, 2, 1];
bubble_sort(&mut data);
assert_eq!(data, [1, 2, 3, 4, 5]);
}
extern crate sort;
use sort::selection_sort;
fn main() {
let mut data = vec![5, 4, 3, 2, 1];
selection_sort(&mut data);
assert_eq!(data, [1, 2, 3, 4, 5]);
}