Skip to main content

counting_sort

Function counting_sort 

Source
pub fn counting_sort(data: &mut Vec<u32>, max_val: u32)
Expand description

Counting sort for u32 values bounded by max_val (inclusive).

Creates a count array of size max_val + 1 and reconstructs sorted data from it. O(n + max_val) time and space.