out
pub fn max_unstable<T: Ord>(v: &mut [T], n: usize) -> &mut [T]
Get the n largest items.
n
This function is not stable, i.e. it may not preserve the order of equal elements. This function should be faster than max in most cases.
max
Panics if n > len.
n > len
let mut v = [-5, 4, 1, -3, 2]; let max = out::max_unstable(&mut v, 3); assert_eq!(max, [1, 2, 4]);