You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// From Wikipedia: Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of elements where the number of elements (n) and the length of the range of possible key values (N) are approximately the same. It requires O(n + N) time.
pub fn pigeonhole_sort(array: &mut [i32]) {
if let (Some(min), Some(max)) = (array.iter().min(), array.iter().max()) {
let holes_range: usize = (max - min + 1) as usize;