Skip to main content

median_usize

Function median_usize 

Source
pub(super) fn median_usize(values: &mut [usize]) -> usize
Expand description

Computes the median of a Vec<usize> in-place (sorts the slice).

Returns 0 for empty input. For even-length inputs returns the lower of the two middle elements (no floating-point required).