competitive_programming_lib/Sorting/
selection_sort.rs1pub fn selection_sort(arr: &mut [i32]) {
2 let n = arr.len();
3 for i in 0..n - 1 {
4 let mut min_index = i;
5 for j in i + 1..n {
6 if arr[j] < arr[min_index] {
7 min_index = j;
8 }
9 }
10 arr.swap(i, min_index);
11 }
12}