51. 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?
#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?52. What is the optimal time required for solving the closest pair problem using divide and conquer approach?
53. Running key cipher is a transposition cipher.
54. Which among the following is an application of the least recently used algorithm?
55. What will be the output of the following code?
void my_recursive_function(int n)
{
if(n == 0)
{
printf("False");
return;
}
if(n == 1)
{
printf("True");
return;
}
if(n%2==0)
my_recursive_function(n/2);
else
{
printf("False");
return;
}
}
int main()
{
my_recursive_function(100);
return 0;
}
void my_recursive_function(int n)
{
if(n == 0)
{
printf("False");
return;
}
if(n == 1)
{
printf("True");
return;
}
if(n%2==0)
my_recursive_function(n/2);
else
{
printf("False");
return;
}
}
int main()
{
my_recursive_function(100);
return 0;
}
56. What should be the return type of rand() function?
57. hat is the correct formula for generating random numbers in the range (lower,upper) using rand()?
58. What will be the plain text corresponding to cipher text "XKS" if the bifid cipher is used with key as "KEY" and period as 5?
59. What is the LCM according to the given Venn Diagram?

60. What will be the worst case time complexity of code to find sum in given query range (l,r) in an array of size n with q number of such queries when we apply MO's algorithm?
Read More Section(Miscellaneous on Data Structures)
Each Section contains maximum 100 MCQs question on Miscellaneous on Data Structures. To get more questions visit other sections.
- Miscellaneous on Data Structures - Section 1
- Miscellaneous on Data Structures - Section 2
- Miscellaneous on Data Structures - Section 3
- Miscellaneous on Data Structures - Section 5
- Miscellaneous on Data Structures - Section 6
- Miscellaneous on Data Structures - Section 7
- Miscellaneous on Data Structures - Section 8
- Miscellaneous on Data Structures - Section 9
- Miscellaneous on Data Structures - Section 10
- Miscellaneous on Data Structures - Section 11
- Miscellaneous on Data Structures - Section 12