In: Computer Science
Q4:
. The sorted values array contains the sixteen integers 1, 2, 3, 13, 13, 20, 24, 25, 30, 32, 40, 45, 50, 52, 57, 60. How many recursive calls are made by our binarySearch method given an initial invocation of binarySearch(45, 0, 15)?
Answer Choices :
2
0
3
4
1
Here is the solution:
The number of recursive calls made = 1
So the answer is last option (option 4) i.e, 1
If you have any doubts please leave a comment!!