17 lines
406 B
Rust
17 lines
406 B
Rust
mod algorithms;
|
|
|
|
use algorithms::insertionsort::Insertionsort;
|
|
use algorithms::Algorithm;
|
|
|
|
fn main() {
|
|
let unsorted: Vec<i32> = vec![2498, 29687, 24, 5, 94545, 8, 51, 152, 48, 871, 5];
|
|
let sorted = match Insertionsort::sort(unsorted) {
|
|
Ok(v) => v,
|
|
Err(e) => {
|
|
println!("Something went wrong! {}", e);
|
|
return;
|
|
}
|
|
};
|
|
println!("{:?}", sorted);
|
|
}
|