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

52/59

Page

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

What will be the auxiliary space requirement of 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.

What is pseudo random number generator?

Select an option to see the answer and solution.

Consider the following recursive implementation used to find the length of a string:
#include<stdio.h>
int recursive_get_len(char *s, int len)
{
      if(s[len] == 0)
        return 0;
      return ________;
}
int main()
{
      char *s = "abcdef";
      int len = recursive_get_len(s,0);
      printf("%d",len);
      return 0;
}
Which of the following lines should be inserted to complete the above code?

Select an option to see the answer and solution.

If n=1, an imaginary solution for the problem exists.

Select an option to see the answer and solution.

Which of the following areas do closest pair problem arise?

Select an option to see the answer and solution.

Which of the following is a page replacement algorithm?

Select an option to see the answer and solution.

Consider the following code snippet to search an element in a linked list:
struct Node
{
     int val;
     struct Node* next;
}*head;
int linear_search(int value)
{
      struct Node *temp = head->next;
      while(temp != 0)
      {
           if(temp->val == value)
              return 1;
           _________;
      }
      return 0;
}
Which of the following lines should be inserted to complete the above code?

Select an option to see the answer and solution.

When was Morse system for telegraphy first used?

Select an option to see the answer and solution.

Which of the following refers to a set of edges with no shared endpoints?

Select an option to see the answer and solution.

Topological sort of a Directed Acyclic graph is?

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 max_of_two(int a, int b)
{
      if(a > b)
        return a;
      return b;
}
int recursive_get_max(struct Node* temp)
{
      if(temp->next == 0)
        return  temp->val;
      return max_of_two(temp->val,recursive_get_max(temp->next));
}
int min_of_two(int a, int b)
{
      if(a < b)
        return a;
      return b;
}
int recursive_get_min(struct Node* temp)
{
      if(temp->next == 0)
        return  temp->val;
      return min_of_two(temp->val,recursive_get_min(temp->next));
}
int main()
{
     int n = 9, arr[9] ={1,3,2,4,5,0,5,6,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->next = 0;
           newNode->val = arr[i];
           temp->next =newNode;
           temp = temp->next;
     }
     int max_num = recursive_get_max(head->next);
     int min_num = recursive_get_min(head->next);
     printf("%d %d",max_num,min_num);
     return 0;
}

Select an option to see the answer and solution.

Who demonstrated the difference in numerical stability?

Select an option to see the answer and solution.

How many constraints does flow have?

Select an option to see the answer and solution.

Consider the graph given below, print the eulerian circuit of the graph using fleury's algorithm?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.

For a graph of degree three, in what time can a Hamiltonian path be found?

Select an option to see the answer and solution.

What is the competitive analysis of the FIFO algorithm?

Select an option to see the answer and solution.

Which of the following is a difference between running key cipher and vigenere cipher?

Select an option to see the answer and solution.

Which of the following is a characteristic of random page replacement algorithm?

Select an option to see the answer and solution.

What is the runtime efficiency of using brute force technique for the closest pair problem?

Select an option to see the answer and solution.

What is the edge chromatic number for the graph given below?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.