1. What is the output of the following code?
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = -4;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = -4;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
2. Consider the fleury's algorithm given below. Which of the following best suits the blank?
Graph must have 0 or 2 odd vertices
if there are 0 odd vertices, start from any vertex
if there are 2 odd vertices, start from any one of them
follow any of the edge, always choose the ______________
repeat for all the edges of the graph
Graph must have 0 or 2 odd vertices if there are 0 odd vertices, start from any vertex if there are 2 odd vertices, start from any one of them follow any of the edge, always choose the ______________ repeat for all the edges of the graph
3. Vertex coloring and chromatic number are one and the same.
4. What is the output of the following code?
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = 0;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = 0;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
5. Which algorithm can be used to find an eulerian cycle in a graph?
6. What is the time complexity of Heap's algorithm?
7. What will be the plain text corresponding to cipher text "RSEADC" if with the number of columns are given to be 3 and route of reading is down the columns?
8. What will be the encrypted text corresponding to plain text "EXAMPLE" using columnar transposition cipher with the keyword as "INDIA"?
9. What will be the slope of the line given by 10x + 5y + 8=0?
10. How many partitions will be formed for the integer 3?
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 4
- 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