Module algos::search[][src]

A module for using searching algorithms.

The array must be crescent ordered.

Functions

binary

Binary Search: Search for the value 'x' in an array. Returns the leftmost term if 'x' not find as Err.

exponential

Exponential Search: Search for the value 'x' in an array. Returns the leftmost term if 'x' not find as Err.

fibonacci

Fibinacci Search: Search for the value 'x' in an array. Returns the the last offset it passed if 'x' not find as Err.

linear

Linear Search: Search for the value 'x' in an array. Returns the last iterator if 'x' not find and array[i] > x.