Interface Searcher


public interface Searcher

Anything that can search an integer array for a target value between left and right indices

Version:
July 2005
Author:
Todd A. Whittaker

Method Summary
 int search(int[] array, int value, int left, int right)
          Searches a subset of an array for the value between the given left and right indices.
 

Method Detail

search

int search(int[] array,
           int value,
           int left,
           int right)
Searches a subset of an array for the value between the given left and right indices.

Parameters:
array - the array to search
value - the target value to find
Returns:
the index (left <= index < right) where the element was found, or a negative number when not found.