Skip to main content

jump_search

Function jump_search 

Source
pub fn jump_search<T: Ord>(arr: &[T], target: &T) -> Result<usize, Error>
Expand description

Jump search.

arr must be sorted in ascending order (caller contract, checked with debug_assert! in debug builds). Returns Ok(index) of the target, or Err(Error::NotFound) if absent.