logo
pub fn bubble_sort_optimized(arr: &mut [i32])
Expand description

Optimized bubble sort

Memorize last swapped index to avoid unnecessary check.