Function bin_search_1

Source
pub fn bin_search_1(data: &[i32], target: i32) -> i32
Expand description

Iterative reimplementation of a recursive binary search algorithm in O(log n) time. This algorithm takes a referenced vec and returns the index of the target, if it exists. Otherwise it returns -1 to indicate that the target is not in the vec.