Function comp_sci::binary_search [-]  [+] [src]

pub fn binary_search<A: Ord>(data: &[A], key: A) -> usize

Finds the position of the key within the given slice.

This is a O(log n) on average and at worst, O(1) at best. Note: the given slice must be ordered.