41. Solve the following recurrence using Master's theorem.
T(n) = 4 T (n/2) + n!
T(n) = 4 T (n/2) + n!
42. The random page replacement algorithm fares better than which of the following algorithm?
43. Set partition problem is an example of NP complete problem.
44. Which letter of the English alphabet has the shortest code in Morse Code?
45. Given the program of naive method.
for 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 formula
for 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 formula46. What will be the slope of the line given by ax + by + c = 0?
47. The first step in the naive greedy algorithm is?
48. In divide and conquer, the time is taken for merging the subproblems is?
49. Is 9 and 28 coprime number?
50. What is the output of the following code?
#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;
}
#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;
}
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