Q341
Open questionT(n) = 4 T (n/2) + n!
Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
1,171
Questions
18/59
Page
Pick an option on a question to see the right answer and solution.
Q341
Open questionSelect an option to see the answer and solution.
Q342
Open questionSelect an option to see the answer and solution.
Q343
Open questionSelect an option to see the answer and solution.
Q344
Open questionSelect an option to see the answer and solution.
Q345
Open questionfor i=1 to n do
for j=1 to n do
Z[i][j]=0;
for k=1 to n do
___________________________
Fill in the blanks with appropriate formulaSelect an option to see the answer and solution.
Q346
Open questionSelect an option to see the answer and solution.
Q347
Open questionSelect an option to see the answer and solution.
Q348
Open questionSelect an option to see the answer and solution.
Q349
Open questionSelect an option to see the answer and solution.
Q350
Open question#include<iostream>
using namespace std;
void printArray(int p[], int n)
{
for (int i = 0; i <= n-1; i++)
cout << p[i] << " ";
cout << endl;
}
void func1(int n)
{
int p[n];
int k = 0;
p[k] = n;
while (true)
{
printArray(p, k+1);
int rem_val = 0;
while (k >= 0 && p[k] == 1)
{
rem_val += p[k];
k--;
}
if (k < 0) return;
p[k]--;
rem_val++;
while (rem_val > p[k])
{
p[k+1] = p[k];
rem_val = rem_val - p[k];
k++;
}
p[k+1] = rem_val;
k++;
}
}
int main()
{
int n=3;
func1(n);
return 0;
}Options are not available for this question.
Select an option to see the answer and solution.
Q351
Open question#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 an option to see the answer and solution.
Q352
Open questionSelect an option to see the answer and solution.
Q353
Open questionSelect an option to see the answer and solution.
Q354
Open questionSelect an option to see the answer and solution.
Q355
Open questionvoid 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;
}Select an option to see the answer and solution.
Q356
Open questionSelect an option to see the answer and solution.
Q357
Open questionSelect an option to see the answer and solution.
Q358
Open questionSelect an option to see the answer and solution.
Q359
Open question
Select an option to see the answer and solution.
Q360
Open questionSelect an option to see the answer and solution.