algo/src/main.rs

17 lines
406 B
Rust
Raw Normal View History

2017-08-27 11:27:35 +00:00
mod algorithms;
2017-08-27 15:26:01 +00:00
use algorithms::insertionsort::Insertionsort;
2017-08-27 11:27:35 +00:00
use algorithms::Algorithm;
2017-08-27 10:44:36 +00:00
fn main() {
2017-08-27 15:26:01 +00:00
let unsorted: Vec<i32> = vec![2498, 29687, 24, 5, 94545, 8, 51, 152, 48, 871, 5];
let sorted = match Insertionsort::sort(unsorted) {
2017-08-27 13:51:31 +00:00
Ok(v) => v,
Err(e) => {
println!("Something went wrong! {}", e);
return;
}
};
2017-08-27 11:27:35 +00:00
println!("{:?}", sorted);
2017-08-27 15:26:01 +00:00
}