public class BinarySearch extends Object
Constructor and Description |
---|
BinarySearch() |
Modifier and Type | Method and Description |
---|---|
static boolean |
binarySearch(int[] data,
int target)
Returns true if the target value is found in the data array.
|
static boolean |
binarySearch(int[] data,
int target,
int low,
int high)
Returns true if the target value is found in the indicated portion of the data array.
|
static boolean |
binarySearchIterative(int[] data,
int target)
Returns true if the target value is found in the data array.
|
static void |
main(String[] args)
Simple test, assuming valid integer given as command-line argument
|
public static boolean binarySearch(int[] data, int target, int low, int high)
public static boolean binarySearch(int[] data, int target)
public static boolean binarySearchIterative(int[] data, int target)
public static void main(String[] args)