Fill in the code to complete the following method for binary search.
```
public static int recursiveBinarySearch(int[] list, int key) {
int low = 0;
int high = list.length - 1;
return __________________________;
}
public static int recursiveBinarySearch(int[] list, int key,
int low, int high) {
if (low > high) // The list has been exhausted without a match
return -low - 1; // Return -insertion point - 1
int mid = (low + high) / 2;
if (key < list[mid])
return recursiveBinarySearch(list, key, low, mid - 1);
else if (key == list[mid])
return mid;
else
return recursiveBinarySearch(list, key, mid + 1, high);
}
```
a. recursiveBinarySearch(list, key)
b. recursiveBinarySearch(list, key, low + 1, high - 1)
c. recursiveBinarySearch(list, key, low - 1, high + 1)
d. recursiveBinarySearch(list, key, low, high)
d. recursiveBinarySearch(list, key, low, high)
You might also like to view...
A compromise to overcome the disadvantages of fixed partitioning and dynamic partitioning is the __________
Fill in the blank(s) with the appropriate word(s).
The _________ tool provides a way to locate text and replace it
Fill in the blank(s) with correct word
Access can export reports formatted for Web pages
Indicate whether the statement is true or false
To view the baseline dates for individual tasks, apply the ____ table to the Entry table.
A. Baseline B. Tracking C. Variance D. Deadlines