CSD201_-_FE_-_SU_2023_401.webp
C

CSD201_-_FE_-_SU_2023_401.webp

  • Media owner Carla89
  • Ngày thêm
(Choose 1 answer)
Consider the binarySearch() function below:intbinarySearch(int[] a, int x, int low, int high)
{ int t, k;
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);
} 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
A. 3
B. 2
C. 4
D. 5
2

Thông tin

Category
CSD201
Thêm bởi
Carla89
Ngày thêm
Lượt xem
2,404
Lượt bình luận
19
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_FE_-_SU_2023_401.webp
File size
54.9 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom