bisect_right

Function bisect_right 

Source
pub fn bisect_right<T: Ord>(data: &[T], x: &T) -> usize
Expand description

Returns the rightmost insertion point for x in a sorted slice.

If x is already present, returns the index after any existing entries.

ยงExample

use d3rs::array::bisect_right;

let data = vec![1, 2, 3, 3, 3, 5, 8];
assert_eq!(bisect_right(&data, &3), 5);
assert_eq!(bisect_right(&data, &4), 5);