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

23/59

Page

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

Consider the following iterative implementation used to find the length of a linked list:
struct Node
{
      int val;
      struct Node *next;
}*head;
int get_len()
{
      struct Node *temp = head->next;
      int len = 0;
      while(_____)
      {
          len++;
          temp = temp->next;
      }
      return len;
}
Which of the following conditions should be checked to complete the above code?

Select an option to see the answer and solution.

What is the output of the following code?
#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);
}
int main()
{
     int n = -100,i;
     recursive_dec_to_bin(n);
     for(i=len-1; i>=0; i--)
     printf("%d",arr[i]);
     return 0;
}

Select an option to see the answer and solution.

The pendant vertex of the graph can also be an articulation point of the graph.

Select an option to see the answer and solution.

Consider the following recursive implementation to find the nth fibonnaci number:
int fibo(int n)
{
     if(n == 1)
        return 0;
     else if(n == 2)
        return 1;
     return fibo(n - 1) + fibo(n - 2);
}
int main()
{
     int n = 5;
     int ans = fibo(n);
     printf("%d",ans);
     return 0;
}
Which of the following is the base case?

Select an option to see the answer and solution.

For how many queens was the extended version of Eight Queen Puzzle applicable for n*n squares?

Select an option to see the answer and solution.

Consider the following iterative code used to convert a decimal number to its equivalent binary:
#include<stdio.h>
void dec_to_bin(int n)
{
      int arr[31],len = 0,i;
      if(n == 0)
      {
          arr[0] = 0;
          len = 1;
      }
      while(n != 0)
      {
          arr[len++] = n % 2;
          _______;
      }
      for(i=len-1; i>=0; i--)
        printf("%d",arr[i]);
}
int main()
{
     int n = 10;
     dec_to_bin(n);
     return 0;
}
Which of the following lines should be inserted to complete the above code?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the ciphered text if rail fence cipher is used for encrypting the plain text "EXAMPLE" with the key value given to be 2?

Select an option to see the answer and solution.

Polybius square cipher is most closely related to?

Select an option to see the answer and solution.

Consider the following pseudocode for the random page replacement algorithm. Which of the following best suits the blank?
Start traversing the pages                                                       
if pages < capacity   
{
    insert the pages until the size of the set reaches capacity or all the pages are processed   
    maintain the pages in a queue         
    increment page fault 
}
else if
{
    current page is present in the set
    do nothing 
}
else 
{
    replace the current page with __________
    store current page in the queue 
    increment page fault
} 
return page faults

Select an option to see the answer and solution.

What is the minimum vertex cover for the following graph given below?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.

The quick hull algorithm runs faster if the input uses non- extreme points.

Select an option to see the answer and solution.

Playfair cipher is an example of . . . . . . . .

Select an option to see the answer and solution.

What is the basic unit of time measurement in Morse code transmission?

Select an option to see the answer and solution.

What is meant by number theory?

Select an option to see the answer and solution.

Given below is the pseudocode of the flooding algorithm. Node and message are denoted by n and m respectively. Which of the following best suits the blank?
if m.id was seen before, discard
else, add m.id to list of seen messages and ______

Select an option to see the answer and solution.

Cross product is also known as?

Select an option to see the answer and solution.

The number of columns in the table used for encryption in rail fence cipher depends upon the given key value.

Select an option to see the answer and solution.

How many possible solutions occur for a 10-queen problem?

Select an option to see the answer and solution.

Hill cipher is harder to crack than playfair cipher.

Select an option to see the answer and solution.