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

10/59

Page

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

Which of the following property of Euler's totient function is used in RSA algorithm?

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()); 
     return 0; 
}

Select an option to see the answer and solution.

What will be the plain text corresponding to cipher text "SCEFJV" if gronsfeld cipher is used with key "1234"?

Select an option to see the answer and solution.

Which of the following cipher uses polybius square cipher in its first step of encrypting data?

Select an option to see the answer and solution.

Which type of graph has no odd cycle in it?

Select an option to see the answer and solution.

How many possible solutions exist for an 8-queen problem?

Select an option to see the answer and solution.

The code length does not depend on the frequency of occurrence of characters.

Select an option to see the answer and solution.

Which of the following cipher does not require a key for encrypting plain text?

Select an option to see the answer and solution.

The random page replacement algorithm may suffer from Belady's anomaly.

Select an option to see the answer and solution.

What will be the auxiliary space complexity of the following code?
#include <bits/stdc++.h> 
using namespace std; 
void convert(int arr[], int n) 
{ 	
	int temp[n]; 
	memcpy(temp, arr, n*sizeof(int)); 
	sort(temp, temp + n); 	
        unordered_map<int, int> map; 	
	int sort_index = 0; 
	for (int i = 0; i < n; i++) 
		map[temp[i]] = sort_index++; 	
	for (int i = 0; i < n; i++) 
		arr[i] = map[arr[i]]; 
} 
void printArr(int arr[], int n) 
{ 
	for (int i=0; i<n; i++) 
		cout << arr[i] << " "; 
} 
int main() 
{ 
	int arr[] = {10, 20, 15, 12, 11, 50}; 
	int n = sizeof(arr)/sizeof(arr[0]); 
	convert(arr , n); 	
	printArr(arr, n); 
	return 0; 
}

Select an option to see the answer and solution.

What is a chromatic number?

Select an option to see the answer and solution.

What is the result of the recurrences which fall under second case of Master's theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc?

Select an option to see the answer and solution.

Encryption in beaufort cipher is done using . . . . . . . .

Select an option to see the answer and solution.

The weight of the cut is not equal to the maximum flow in a network.

Select an option to see the answer and solution.

What is the size of the smallest maximal independent set of a chain of 7 nodes?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

In which layer of the computer networks is the flooding algorithm implemented?

Select an option to see the answer and solution.

What is the running time of Karger's algorithm to find the minimum cut in a graph?

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

Select an option to see the answer and solution.

The time is taken to find the 'n' points that lie in a convex quadrilateral is?

Select an option to see the answer and solution.