21. The main time taking step in fractional knapsack problem is . . . . . . . .
22. Solve the following recurrence using Master's theorem.
T(n) = T (n/2) + 2n
T(n) = T (n/2) + 2n
23. What is the output of the following code?
#include<stdio.h>
int recursive_get_len(char *s, int len)
{
if(s[len] == 0)
return 0;
return 1 + recursive_get_len(s, len+1);
}
int main()
{
char *s = "123-1-2-3";
int len = recursive_get_len(s,0);
printf("%d",len);
return 0;
}
#include<stdio.h>
int recursive_get_len(char *s, int len)
{
if(s[len] == 0)
return 0;
return 1 + recursive_get_len(s, len+1);
}
int main()
{
char *s = "123-1-2-3";
int len = recursive_get_len(s,0);
printf("%d",len);
return 0;
}
24. A connected graph has a maximum of (n - 2) cut vertices.
25. Which of the following will generate random numbers in the range 1-100 (both inclusive)?
26. What will be the ciphered text corresponding to "EXAMPLE" if trithemius cipher is used for encryption?
27. Euclidean algorithm does not require the calculation of prime factors.
28. A graph with chromatic number less than or equal to k is called?
29. What is the output of the following code?
#include<stdio.h>
#include<string.h>
void reverse_string(char *s)
{
int len = strlen(s);
int i,j;
i=0;
j=len-1;
while(i < j)
{
char tmp = s[i];
s[i] = s[j];
s[j] = tmp;
i++;
j--;
}
}
int main()
{
char s[100] = "reverse";
reverse_string(s);
printf("%s",s);
return 0;
}
#include<stdio.h>
#include<string.h>
void reverse_string(char *s)
{
int len = strlen(s);
int i,j;
i=0;
j=len-1;
while(i < j)
{
char tmp = s[i];
s[i] = s[j];
s[j] = tmp;
i++;
j--;
}
}
int main()
{
char s[100] = "reverse";
reverse_string(s);
printf("%s",s);
return 0;
}
30. Which page replacement strategy uses referenced bits and modified bits to replace the page?
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