21. 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;
}
#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;
}
22. What is pseudo random number generator?
23. 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?
#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?24. If n=1, an imaginary solution for the problem exists.
25. Which of the following areas do closest pair problem arise?
26. Which of the following is a page replacement algorithm?
27. 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?
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?28. When was Morse system for telegraphy first used?
29. Which of the following refers to a set of edges with no shared endpoints?
30. Topological sort of a Directed Acyclic graph is?
Read More Section(Miscellaneous on Data Structures)
Each Section contains maximum 100 MCQs question on Miscellaneous on Data Structures. To get more questions visit other sections.
- Miscellaneous on Data Structures - Section 1
- Miscellaneous on Data Structures - Section 2
- Miscellaneous on Data Structures - Section 3
- Miscellaneous on Data Structures - Section 4
- Miscellaneous on Data Structures - Section 5
- Miscellaneous on Data Structures - Section 6
- Miscellaneous on Data Structures - Section 7
- Miscellaneous on Data Structures - Section 8
- Miscellaneous on Data Structures - Section 9
- Miscellaneous on Data Structures - Section 10
- Miscellaneous on Data Structures - Section 12