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

36/59

Page

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

The code for printing combinations is in-place.

Select an option to see the answer and solution.

The problem of maximizing the sum of weights on edges connecting matched pairs of vertices is?

Select an option to see the answer and solution.

What is the clique size of the line graph of bipartite graph?

Select an option to see the answer and solution.

. . . . . . . . is a typical online problem from the competitive analysis to determine the optimal solution.

Select an option to see the answer and solution.

What is the worst case time complexity of quickselect?

Select an option to see the answer and solution.

A hash table contains 10 slots and uses coalesced hashing to resolve collisions. The hash function used is key % 10. If the values 67, 23, 45, 11, 95 are inserted in the table, in what location would the key value 95 be inserted?

Select an option to see the answer and solution.

What is the formula for Euclidean algorithm?

Select an option to see the answer and solution.

What is the average case complexity of a quick hull algorithm?

Select an option to see the answer and solution.

What will be the chromatic number for a line graph having n vertices?

Select an option to see the answer and solution.

In the edge coloring of a graph, which edges should be colored with different colors?

Select an option to see the answer and solution.

The success probability of Karger's algorithm can be increased.

Select an option to see the answer and solution.

Which among the following is the NP-complete problem?

Select an option to see the answer and solution.

Consider the following iterative implementation used to reverse a string:
#include<stdio.h>
#include<string.h>
void reverse_string(char *s)
{
     int len = strlen(s);
     int i,j;
     i=0;
     j=len-1;
     while(______)
     {
         char tmp = s[i];
         s[i] = s[j];
         s[j] = tmp;
         i++;
         j--;
     }
}
Which of the following lines should be inserted to complete the above code?

Select an option to see the answer and solution.

According to inclusion-exclusion principle, a n-tuple wise intersection is included if n is even.

Select an option to see the answer and solution.

Trithemius cipher is an example of . . . . . . . .

Select an option to see the answer and solution.

Euclid's algorithm is used for finding . . . . . . . .

Select an option to see the answer and solution.

Which of the following has maximum clique size 2?

Select an option to see the answer and solution.

What is the LCM of 8 and 13?

Select an option to see the answer and solution.

What will be the worst case time complexity for the following code?
#include <stdio.h> 
bool func(int arr[], int n, int sum) 
{ 
    if (sum == 0) 
	return true; 
    if (n == 0 && sum != 0) 
	return false; 
    if (arr[n-1] > sum) 
	return func(arr, n-1, sum); 
    return func(arr, n-1, sum) || func(arr, n-1, sum-arr[n-1]); 
} 
int main() 
{ 
    int arr[] = {4,6, 12, 2}; 
    int sum = 12; 
    int n = sizeof(arr)/sizeof(arr[0]); 
    if (func(arr, n, sum) == true) 
	printf("true"); 
    else
	printf("false"); 
    return 0; 
}

Select an option to see the answer and solution.

Gronsfeld cipher is a substitution cipher.

Select an option to see the answer and solution.