Skip to main content

sort_reverse

Function sort_reverse 

Source
pub fn sort_reverse<T>(array: &mut [T])
where T: Ord + Clone,
Expand description

Sort in descending order using a shell sort algorithm.

use buldak::shell;

let mut nums = [1, 4, 2, 3, 5, 111, 234, 21, 13];
shell::sort_reverse(&mut nums);
assert_eq!(nums, [234, 111, 21, 13, 5, 4, 3, 2, 1]);