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

15/59

Page

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

Which is the smallest number of 3 digits that is divisible by 2, 4, 8?

Select an option to see the answer and solution.

What will be the output for following code?
#include<stdio.h> 
int func(int x,  int y) 
{ 
	if (y == 0) 
		return 1; 
	else if (y%2 == 0) 
		return func(x, y/2)*func(x, y/2); 
	else
		return x*func(x, y/2)*func(x, y/2); 
} 
int main() 
{ 
	int x = 2; 
    int y = 3; 
 
	printf("%d", func(x, y)); 
	return 0; 
}

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
int get_sum(int n)
{
      int sm, i;
      for(i = 1; i <= n; i++)
        sm += i;
      return sm;
}
int main()
{
    int n = 10;
    int ans = get_sum(n);
    printf("%d",ans);
    return 0;
}

Select an option to see the answer and solution.

The shortest distance between a line and a point is achieved when?

Select an option to see the answer and solution.

Which of the following is not a transposition cipher?

Select an option to see the answer and solution.

What is the running time of Dinic's blocking flow algorithm?

Select an option to see the answer and solution.

Which type of graph has all the vertex of the first set connected to all the vertex of the second set?

Select an option to see the answer and solution.

The greedy algorithm can find a minimal vertex cover in polynomial time for which among the following?

Select an option to see the answer and solution.

Under what case of Master's theorem will the recurrence relation of binary search fall?

Select an option to see the answer and solution.

What is meant by integer partition?

Select an option to see the answer and solution.

Consider the following algorithm for finding the nth Catalan number using dynamic approach. which of the following steps best fills the blank?
1) create and initialize a variable 'n' and an array 'c'
2) initialize the first two values of array as 1
3) _______________________
4) return c[n]

Select an option to see the answer and solution.

In Morse Code, each dot or dash within a character is followed by a period of signal absence. What is the name of that signal?

Select an option to see the answer and solution.

We can solve any recurrence by using Master's theorem.

Select an option to see the answer and solution.

For a hamming code of parity bit m=8, what is the total bits and data bits?

Select an option to see the answer and solution.

A non-deterministic algorithm is said to be non-deterministic polynomial if the time-efficiency of its verification stage is polynomial.

Select an option to see the answer and solution.

In a graph, every maximum matching is a maximal matching.

Select an option to see the answer and solution.

The optimal time obtained through divide and conquer approach using merge sort is the best case efficiency.

Select an option to see the answer and solution.

What is the output of the following code?
#include<stdio.h>
int recursive_binary_search(int *arr, int num, int lo, int hi)
{
      if(lo > hi)
        return -1;
      int mid = (lo + hi)/2;
      if(arr[mid] == num)
        return mid;
      else if(arr[mid] < num)
          lo = mid + 1;
      else
          hi = mid - 1;
      return recursive_binary_search(arr, num, lo, hi);
}
int main()
{
      int arr[5] = {5,4,3,2,1},num = 1,len = 5;
      int indx = recursive_binary_search(arr,num,0,len-1);
      printf("Index of %d is %d",num,indx);
      return 0;
}

Select an option to see the answer and solution.

Backtracking algorithm is faster than the brute force technique

Select an option to see the answer and solution.

What does Maximum flow problem involve?

Select an option to see the answer and solution.