71. 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] = "rotator";
char t[100];
strcpy(t,s);
reverse_string(s);
if(strcmp(t,s) == 0)
printf("Yes");
else
printf("No");
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] = "rotator";
char t[100];
strcpy(t,s);
reverse_string(s);
if(strcmp(t,s) == 0)
printf("Yes");
else
printf("No");
return 0;
}
72. What is the chromatic number of compliment of line graph of bipartite graph?
73. Which of the following is an NP complete problem?
74. Which of the following is the correct mathematical application of Euclid's algorithm?
75. What will be the time complexity of the brute force approach used to find the articulation points in a given graph?
For every vertex V, do:
Remove V from the graph
See if the graph remains connected
If graph is disconnected, add V to the resultant set
Add V back to the graph
For every vertex V, do: Remove V from the graph See if the graph remains connected If graph is disconnected, add V to the resultant set Add V back to the graph
76. What is the running time of the Huffman algorithm, if its implementation of the priority queue is done using linked lists?
77. Running key cipher is harder to decipher than keyword cipher.
78. Including a parity bit along with the data surely detects the errors.
79. What is the time complexity of the recursive implementation used to convert a decimal number to its binary equivalent?
#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
if(n == 0 && len == 0)
{
arr[len++] = 0;
return;
}
if(n == 0)
return;
arr[len++] = n % 2;
recursive_dec_to_bin(n/2);
}
#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
if(n == 0 && len == 0)
{
arr[len++] = 0;
return;
}
if(n == 0)
return;
arr[len++] = n % 2;
recursive_dec_to_bin(n/2);
}
80. What is the time complexity for finding a Hamiltonian path for a graph having N vertices (using permutation)?
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 4
- 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