Function sort_steps::counting_sort
source · pub fn counting_sort(data: Vec<usize>, min: usize, max: usize) -> Vec<usize>
Expand description
Sorts a slice of data using the heap sort algorithm with a custom comparator.
Examples
let numbers = [5, 9, 3, 6, 8, 2, 1, 7, 4];
println!("Heap Sort Steps:");
for (i, v) in heap_sort_by(&numbers, |a, b| a.partial_cmp(b)).enumerate() {
println!("#{:02}: {:?}", i, v);
}