Respuesta :
Answer:
D. low = 2, high = 1
Explanation:
Middle is 2
First call: low = 0 high = 1
Middle is 0
Second call: low = 1 high = 1
Middle is 2
Third call: low = 2 high = 1
A technique of identifying a problem (or a set of strategies) in elements of (a simplified version of) itself is known as recursion. therefore, the final answer is "low = 1, high = 1".
Recursion:
- In the given code, an integer array that is "arr" holds an integer value.
- In the next step, an integer variable "result" is declared that calls the binarySearch method.
- In the first time calls Recursion 1, when low = 0 and high = 4 its mid = 2, therefore arr[2] = 12 > 5 = high = mid-1
- In the second time calls Recursion 2, when low = 0 and high = 1 its mid =0, therefore arr[0] = 2 < 5 = low = mid+1
- In the third time calls Recursion 3, when low = 1 and high = 1 its mid =1, therefore arr[1] = 3 < 5 = element not found
Therefore, the final answer is "Option C", that is "low = 1, high = 1".
Find out more information about the Recursion here:
brainly.com/question/17298888