diff --git a/src/main.rs b/src/main.rs index 1637f23..67fc76f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,27 @@ fn main() { println!("Hello, world!"); - // -} - -//Takes in an array, and returns a sorted array -fn selection_sort() { + // Array to use + let test_array : [i32; 6] = [5, 35, 4, 8, 1, 2]; + print!("Here are the values of the array, unsorted: "); + for n in test_array { + print!("{}, ", n); + } } -fn random_array(size : u32) -> +//selection_sort : implementation of selection sort +//Takes in an array, and returns a sorted array usin +//the selection sort algorithm + +// Im going to assume that all functions take in immutable params +// Which is nice... but are they references? + +//No. Rust is strictly pass by value on default. +// => we must pass a reference to the array +fn selection_sort(unsorted_array : &mut [i32]) { + + + +}