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

45/59

Page

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

What is the output of the following code?
#include<stdio.h>
int get_len(char *s)
{
      int len = 0;
      while(s[len] != '\0')
        len++;
      return len;
}
int main()
{
      char *s = "lengthofstring";
      int len = get_len(s);
      printf("%d",len);
      return 0;
}

Select an option to see the answer and solution.

Which of the following cipher does not require the use of tabula recta?

Select an option to see the answer and solution.

What is the output of the following code?
int fact(int n)
{
      if(n == 0)
        return 1;
      return n * fact(n - 1);
}
int main()
{
      int n = 0;
      int ans = fact(n);
      printf("%d",ans);
      return 0;
}

Select an option to see the answer and solution.

What will be the time complexity of update query operation in an array of size n when we use square root optimization?

Select an option to see the answer and solution.

Given below is the pseudocode of the vertex cover problem. Which of the following best suits the blank?
Vertex_Cover(G = (V, E))
{
    A = { }
    while (E!=0)
    {
        pick any edge (u, v) from E
        add u and v to A
        ________________
    }
    return A
}

Select an option to see the answer and solution.

Who invented the concept of inclusion-exclusion principle?

Select an option to see the answer and solution.

In a stack algorithm, the set of pages in a k-frame memory is always a subset of pages in a . . . . . . . . frame memory.

Select an option to see the answer and solution.

What will be the chromatic index for a complete graph having n vertices (consider n to be an even number)?

Select an option to see the answer and solution.

Which of the following correctly defines poly graphic substitution cipher?

Select an option to see the answer and solution.

What is the advantage of iterative code for finding power of number over recursive code?

Select an option to see the answer and solution.

The Euler's circuit problem can be solved in?

Select an option to see the answer and solution.

Which of the following cipher was used by freemasons?

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
#include<stdlib.h>
struct Node
{
      int val;
      struct Node *next;
}*head;
int get_len()
{
      struct Node *temp = head->next;
      int len = 0;
      while(temp != 0)
      {
          len++;
          temp = temp->next;
      }
      return len;
}
int main()
{
      int arr[10] = {1,2,3,4,5}, n = 5, i;
      struct Node *temp, *newNode;
      head = (struct Node*)malloc(sizeof(struct Node));
      head->next = 0;
      int len = get_len();
      printf("%d",len);
      return 0;
}

Select an option to see the answer and solution.

The letters of a word are separated by a space of how many units?

Select an option to see the answer and solution.

What will be the plain text corresponding to cipher text "SCSEMG" if rail fence cipher is used with key value 2?

Select an option to see the answer and solution.

Which one of the following is an application of the backtracking algorithm?

Select an option to see the answer and solution.

What is the objective of tower of hanoi puzzle?

Select an option to see the answer and solution.

A complete bipartite graph is a one in which each vertex in set X has an edge with set Y. Let n be the total number of vertices. For maximum number of edges, the total number of vertices hat should be present on set X is?

Select an option to see the answer and solution.

Which among the following represents best-case time complexity for activity selection problem?

Select an option to see the answer and solution.

Which of the following equals the a x b ( a and b are two vectors)?

Select an option to see the answer and solution.