Function search_sort::search::exp [−][src]
pub fn exp<T: Ord>(slice: &[T], value: &T) -> Option<usize>
Expand description
An implementation of exponential search.
Finds a range where the element may be found, and calls binary_first
on
it. This range is between a power of 2 and its next power.
Examples
use search_sort::search; let slice = [2, 4, 6, 7, 11, 12, 17]; assert_eq!(search::exp(&slice, &6), Some(2));