pub fn median<T>(array: impl AsRef<[T]>) -> Twhere T: Add<Output = T> + Sub<Output = T> + Div<Output = T> + Mul<Output = T> + PartialOrd + Copy + From<u8>,
Gets the median from a sorted slice.
let mut vec = vec![10, 5, 1, 4, 2, 8, 9, 7, 3, 6]; vec.sort(); assert_eq!(median(vec), 5);
If not sorted the output will be invalid.