Vidyalelo
Data Structure · all questions

Miscellaneous on Data Structures
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

1,171

Questions

43/59

Page

Pick an option on a question to see the right answer and solution.

How many edges will a tree consisting of N nodes have?

Select an option to see the answer and solution.

The chromatic number of star graph with 3 vertices is greater than that of a complete graph with 3 vertices.

Select an option to see the answer and solution.

Which term defines all the complete bipartite graph that are trees?

Select an option to see the answer and solution.

Which of the following is an application of the Catalan numbers?

Select an option to see the answer and solution.

Analysis of the optimal paging problem has been done through. . . . . . . .

Select an option to see the answer and solution.

Halting problem is an example for?

Select an option to see the answer and solution.

Which of the following is also known as LCM?

Select an option to see the answer and solution.

What will be the ciphered text corresponding to plain text "example" if an affine cipher is used with key values as a=5, b=10?

Select an option to see the answer and solution.

What is the distance between the lines 3x-4y+7=0 and 3x-4y+5=0?

Select an option to see the answer and solution.

When was the Eight Queen Puzzle published?

Select an option to see the answer and solution.

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 = "abcdef";
      int len = recursive_get_len(s,0);
      printf("%d",len);
      return 0;
}

Select an option to see the answer and solution.

To find an eulerian cycle by fleury's algorithm, from which vertex you should start if the graph has no odd vertices?

Select an option to see the answer and solution.

Vertex covering can be a good approach to which type of the problems?

Select an option to see the answer and solution.

Which of the following logical programming languages is not based on backtracking?

Select an option to see the answer and solution.

Consider the following recursive implementation to find the factorial of a number. Which of the lines is the base case?
int fact(int n)
{
     if(n == 0)
        return 1;
     return n * fact(n - 1);
}
int main()
{
      int n = 5;
      int ans = fact(n);
      printf("%d",ans);
      return 0;
}

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
int get_max_element(int *arr,int n)
{
      int i, max_element = arr[0];
      for(i = 1; i < n; i++)
        if(arr[i] > max_element)
          max_element = arr[i];
      return max_element;
}
int get_min_element(int *arr, int n)
{
      int i, min_element;
      for(i = 1; i < n; i++)
        if(arr[i] < min_element)
          min_element = arr[i];
      return min_element;
}
int main()
{
     int n = 7, arr[7] = {1,1,1,0,-1,-1,-1};
     int max_element = get_max_element(arr,n);
     int min_element = get_min_element(arr,n);
     printf("%d %d",max_element,min_element);
     return 0;
}

Select an option to see the answer and solution.

Which of the following is the binary representation of 100?

Select an option to see the answer and solution.

Where is the n-queens problem implemented?

Select an option to see the answer and solution.

Fleury's algorithm can be used to print which type of paths or circuits?

Select an option to see the answer and solution.

Which among the following is a disadvantage of the not recently used algorithm?

Select an option to see the answer and solution.