rust_algorithm_club::sorting

Function counting_sort

Source
pub fn counting_sort<F, T>(arr: &mut [T], min: usize, max: usize, key: F)
where F: Fn(&T) -> usize, T: Clone,
Expand description

Counting sort

  • arr - Collection of value to be sorted in place.
  • min - Lower bound of the integer range.
  • max - Upper bound of the integer range.
  • key - Function extracting key witn the integer range from elements.