pub fn max_index<T: PartialOrd>(arr: &[T]) -> Option<usize>Expand description
Scans through the array, looking for the maximum value contained within it, using the
PartialOrd operation. Returns the first index of the maximum detected value.
ยงExample
use irox_tools::arrays::max_index;
let arr = &[8,2,7,4,6,3,8,2,15,1,6];
let max_idx = max_index(arr);
assert_eq!(max_idx, Some(8));