1. What is the least time in which we can raise a number x to power y?
2. In a graph G, the total number of edges in maximum matching is called?
3. Topological sort is equivalent to which of the traversals in trees?
4. In the coalesced hashing, the collided element is placed in the first empty place of the hash table.
5. Which of the following is not an application of Euclid's algorithm?
6. In a perfect matching of graph G, every vertex is connected to how many edges?
7. What will be the plain text corresponding to cipher text "IWRWHS" if running key cipher is used with keyword as "DATASTRUCTURE"?
8. How many times is the recursive function called, when the following code is executed?
void my_recursive_function(int n)
{
if(n == 0)
return;
printf("%d ",n);
my_recursive_function(n-1);
}
int main()
{
my_recursive_function(10);
return 0;
}
void my_recursive_function(int n)
{
if(n == 0)
return;
printf("%d ",n);
my_recursive_function(n-1);
}
int main()
{
my_recursive_function(10);
return 0;
}
9. Which of the following is an example of asymmetric encryption technique?
10. What is the time complexity of the following iterative code used to find the smallest and largest element in a linked list?
#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int get_max()
{
struct Node* temp = head->next;
int max_num = temp->val;
while(temp != 0)
{
if(temp->val > max_num)
max_num = temp->val;
temp = temp->next;
}
return max_num;
}
int get_min()
{
struct Node* temp = head->next;
int min_num = temp->val;
while(temp != 0)
{
if(temp->val < min_num)
min_num = temp->val;
temp = temp->next;
}
return min_num;
}
int main()
{
int i, n = 9, arr[9] ={8,3,3,4,5,2,5,6,7};
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 = get_max();
int min_num = get_min();
printf("%d %d",max_num,min_num);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int get_max()
{
struct Node* temp = head->next;
int max_num = temp->val;
while(temp != 0)
{
if(temp->val > max_num)
max_num = temp->val;
temp = temp->next;
}
return max_num;
}
int get_min()
{
struct Node* temp = head->next;
int min_num = temp->val;
while(temp != 0)
{
if(temp->val < min_num)
min_num = temp->val;
temp = temp->next;
}
return min_num;
}
int main()
{
int i, n = 9, arr[9] ={8,3,3,4,5,2,5,6,7};
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 = get_max();
int min_num = get_min();
printf("%d %d",max_num,min_num);
return 0;
}
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 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 11
- Miscellaneous on Data Structures - Section 12