1
Multiple choices 1/50
(Choose 1 answer)
Next
Consider the binarySearch() function below:int binarySearch(int[] a, int x, int low, int high)
{ int t, k;
} Suppose the array a is given by the statement:int a = {2,4,6,8,10,12,14, 16);For the call binarySearch(a,7,2, 5), how many calls to this will be made, including the origina
if(low > high) return(-1);k = (low + high)/2;
if(a[k] == x) return(k);
if(x<a[k]) return(binarySearch(a,x, low, k-1);else return(binarySearch(a,x,k+1,high);
A. 3
B. 2
C. 4
D. 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 46
47
48
49
50