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

41/59

Page

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

Encryption in Rail fence cipher is done using . . . . . . . .

Select an option to see the answer and solution.

What is the time complexity of matrix multiplied recursively by Divide and Conquer Method?

Select an option to see the answer and solution.

What will be the time complexity of the following code which raises an integer x to the power y?
#include<stdio.h> 
int power(int x,  int y) 
{ 
	if (y == 0) 
		return 1; 
	else if (y%2 == 0) 
		return power(x, y/2)*power(x, y/2); 
	else
		return x*power(x, y/2)*power(x, y/2); 
} 
int main() 
{ 
	int x = 2; 
    int y = 3; 
 
	printf("%d", power(x, y)); 
	return 0; 
}

Select an option to see the answer and solution.

Optimal page replacement algorithm is also called as . . . . . . . .

Select an option to see the answer and solution.

Who published the eight queens puzzle?

Select an option to see the answer and solution.

Encryption in hill cipher is done using . . . . . . . .

Select an option to see the answer and solution.

Which of the following correctly defines poly alphabetic cipher?

Select an option to see the answer and solution.

What is the condition for proper coloring of a graph?

Select an option to see the answer and solution.

Which of the following page replacement algorithms return the minimum number of page faults?

Select an option to see the answer and solution.

What is the space complexity of program to reverse stack recursively?

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 recursive_get_len(struct Node *current_node)
{
      if(current_node == 0)
        return 0;
      return 1 + recursive_get_len(current_node->next);
}
int main()
{
      int arr[10] = {-1,2,3,-3,4,5,0}, n = 7, i;
      struct Node *temp, *newNode;
      head = (struct Node*)malloc(sizeof(struct Node));
      head->next = 0;
      temp = head;
      for(i=0; i<n; i++)
      {
          newNode = (struct Node*)malloc(sizeof(struct Node));
          newNode->val = arr[i];
          newNode->next = 0;
          temp->next = newNode;
          temp = temp->next;
      }
      int len = recursive_get_len(head->next);
      printf("%d",len);
      return 0;
}

Select an option to see the answer and solution.

What will be the output for the following code?
#include <stdio.h> 
#include <math.h> 
void PowerSet(char *set, int set_size) 
{ 
	unsigned int pow_size = pow(2, set_size); 
	int count, j; 	
	for(count = 0; count < pow_size; count++) 
	{ 
	     for(j = 0; j < set_size; j++) 
	     { 
 
		if(count & (1<<j)) 
			printf("%c", set[j]); 
	     } 
	     printf(","); 
	} 
} 
int main() 
{ 
	char strset[] = {'a','b','c'}; 
	PowerSet(strset, 3); 
	return 0; 
}

Select an option to see the answer and solution.

Calculating the chromatic index of a graph is a . . . . . . . .

Select an option to see the answer and solution.

What is the formula used for encryption of data using affine cipher(a,b are constants and x is the numerical equivalent of a letter to be encrypted)?

Select an option to see the answer and solution.

What is testing of a complete bipartite subgraph in a bipartite graph problem called?

Select an option to see the answer and solution.

What will be the plain text corresponding to cipher text "KEPWSN" if running key cipher is used with keyword as "DATASTRUCTURE"?

Select an option to see the answer and solution.

Which of the following operation will give a vector that is perpendicular to both vectors a and b?

Select an option to see the answer and solution.

What is the GCD of 8 and 12?

Select an option to see the answer and solution.

What will be the ciphered text corresponding to "ALGORITHM" if bifid cipher is used for encryption with key as "KEY" with a period as 5?

Select an option to see the answer and solution.

Which of the following recurrence relations can be used to find the nth fibonacci number?

Select an option to see the answer and solution.