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

50/59

Page

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

The fleury's algorithm can be applied to a graph if the degree of all the vertices is even or two vertices with an odd degree.

Select an option to see the answer and solution.

Consider the following 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;
        __________;
      recursive_dec_to_bin(n/2);
}
int main()
{
     int n = 100,i;
     recursive_dec_to_bin(n);
     for(i=len-1; i>=0; i--)
     printf("%d",arr[i]);
     return 0;
}
Which of the following lines should be inserted to complete the above code?

Select an option to see the answer and solution.

Route cipher is closely related to?

Select an option to see the answer and solution.

The Euclid's algorithm runs efficiently if the remainder of two numbers is divided by the minimum of two numbers until the remainder is zero.

Select an option to see the answer and solution.

Subset sum problem is an example of NP-complete problem.

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
int cnt =0;
int my_function(int n, int sm)
{
      int i, tmp_sm;
      for(i=1;i<=n;i++)
      {
          tmp_sm = recursive_sum_of_digits(i);
          if(tmp_sm == sm)
            cnt++;
      }
      return cnt;
}
int recursive_sum_of_digits(int n)
{
      if(n == 0)
        return 0;
      return n % 10 + recursive_sum_of_digits(n/10);
}
int main()
{
      int n = 20, sum = 3;
      int ans = my_function(n,sum);
      printf("%d",ans);
      return 0;
}

Select an option to see the answer and solution.

In which of the following cipher the plain text and the ciphered text have same set of letters?

Select an option to see the answer and solution.

What is the bidirectional variant of selection sort?

Select an option to see the answer and solution.

In recursion, the condition for which the function will stop calling itself is . . . . . . . .

Select an option to see the answer and solution.

Stack can be reversed without using extra space by . . . . . . . .

Select an option to see the answer and solution.

Consider the array {1, 1, 1, 1, 1}. Select the wrong option?

Select an option to see the answer and solution.

The type of encoding where no character code is the prefix of another character code is called?

Select an option to see the answer and solution.

Under which of the following scenarios is page replacement algorithm required?

Select an option to see the answer and solution.

Mo's algorithm can only be used for problems where the query can be calculated from the result of the previous query.

Select an option to see the answer and solution.

What can be the minimum sum of digits for a 4 digit number?

Select an option to see the answer and solution.

Recursive solution of subset sum problem is faster than dynamic problem solution in terms of time complexity.

Select an option to see the answer and solution.

Predict the output of the following code.
#include <stdlib.h> 
int main() 
{ 
     srand(0); 
     printf("%d\n", rand()%50); 
     return 0; 
}

Select an option to see the answer and solution.

A simple acyclic path between source and sink which pass through only positive weighted edges is called?

Select an option to see the answer and solution.

Consider the figure given below. If a message is flooded from node A, it will reach to which of the following nodes?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.

In which of the following cases is the reversal of a string not equal to the original string?

Select an option to see the answer and solution.