Function algos::sort::insection [−][src]
pub fn insection<T: Ord, C: Fn(&T, &T) -> bool>(a: &mut [T], cmp: &C)
Insection Sort: Sort a slice according to the way you define the cmp parameter.
Time complexity | Space complexity | |
---|---|---|
Best: | Ω(n) | |
Avrg: | θ(n^2) | |
Worst: | O(n^2) | O(1) |
#Examples
use algos::sort; let mut v = [9, 3, 5, 7, 8, 7]; // Crescent sorting sort::insection(&mut v, &|a,b| a<b);