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

25/59

Page

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

Pseudo random number generators can be used for data encryption.

Select an option to see the answer and solution.

Suppose two activities A and B, having start and finish time as SA, FA and SB, FB respectively. Both the activities are said to be compatible, under which of the following condition?

Select an option to see the answer and solution.

Which algorithm is used to solve a minimum cut algorithm?

Select an option to see the answer and solution.

What is the time complexity of the fastest known matrix multiplication algorithm?

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
#include<string.h>
void recursive_reverse_string(char *s, int left, int right)
{
     if(left < right)
     {
         char tmp = s[left];
         s[left] = s[right];
         s[right] = tmp;
         recursive_reverse_string(s, left+1, right-1);
     }
}
int main()
{
     char s[100] = "recursion";
     int len = strlen(s);
     recursive_reverse_string(s,0,len-1);
     printf("%s",s);
     return 0;
}

Select an option to see the answer and solution.

What is the output of the following code?
void my_recursive_function(int *arr, int val, int idx, int len)
{
    if(idx == len)
    {
         printf("-1");
         return ;
    }
    if(arr[idx] == val)
    {
         printf("%d",idx);
         return;
    }
    my_recursive_function(arr,val,idx+1,len);
}
int main()
{
     int array[10] = {7, 6, 4, 3, 2, 1, 9, 5, 0, 8};
     int value = 2;
     int len = 10;
     my_recursive_function(array, value, 0, len);
     return 0;
}

Select an option to see the answer and solution.

Which of the following is a mono alphabetic substitution cipher?

Select an option to see the answer and solution.

Encryption in Vigenere cipher is done using . . . . . . . .

Select an option to see the answer and solution.

What is the general formula for finding the magnitude of the cross product of two vectors a and b with angle θ between them?

Select an option to see the answer and solution.

What is the best case time complexity of quickselect?

Select an option to see the answer and solution.

Quickselect's algorithm is similar to which of the following algorithm?

Select an option to see the answer and solution.

Which of the following algorithms is similar to a quickhull algorithm?

Select an option to see the answer and solution.

In what manner is a state-space tree for a backtracking algorithm constructed?

Select an option to see the answer and solution.

What is the worst case complexity of quick hull?

Select an option to see the answer and solution.

Which of the following algorithms is the best approach for solving Huffman codes?

Select an option to see the answer and solution.

What will be the worst case time complexity of code to find sum in given query range (l,r) in an array of size n with q number of such queries?

Select an option to see the answer and solution.

Fractional knapsack problem is solved most efficiently by which of the following algorithm?

Select an option to see the answer and solution.

Which among the following problem uses the vertex cover approach?

Select an option to see the answer and solution.

What is the total running time of Euclid's algorithm?

Select an option to see the answer and solution.

. . . . . . . . is the class of decision problems that can be solved by non-deterministic polynomial algorithms.

Select an option to see the answer and solution.