Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures

Consider the following recursive implementation of the binary search: #include<stdio.h> int recursive_binary_search(int *arr, int num, int lo, int hi) { if(lo > hi) return -1; int mid = (lo + hi)/2; if(arr[mid] == num) return mid; else if(arr[mid] < num) __________; else hi = mid - 1; return recursive_binary_search(arr, num, lo, hi); } int main() { int arr[8] ={0,0,0,0,3,5,6,7},num = 7,len = 8; int indx = recursive_binary_search(arr,num,0,len-1); printf("Index of %d is %d",num,indx); return 0; } Which of the following lines should be added to complete the above code?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • lo = mid + 1

Related Computer Questions

Where is a hub specified in the OSI model? Which upgrade involves shutting down the old MySQL version and replacing the old binaries? The system variable controls the size of the table cache ______ HMP (Host Monitoring Protocol) is: Which of the following functions can be used to make the arrow black?