51. Who is the creator of Modern International Morse Code?
52. What is the multiplicity for the adjacency matrix of complete bipartite graph for 0 Eigen value?
53. What is the output of the following code?
int fibo(int n)
{
if(n == 1)
return 0;
else if(n == 2)
return 1;
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
int n = 5;
int ans = fibo(n);
printf("%d",ans);
return 0;
}
int fibo(int n)
{
if(n == 1)
return 0;
else if(n == 2)
return 1;
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
int n = 5;
int ans = fibo(n);
printf("%d",ans);
return 0;
}
54. Maximum matching is also called as maximum cardinality matching.
55. What will be the output for the following code?
#include<stdio.h>
void combination(int arr[],int n,int r,int index,int aux[],int i);
void print(int arr[], int n, int r)
{
int aux[r];
combination(arr, n, r, 0, aux, 0);
}
void combination(int arr[], int n, int r, int index, int aux[], int i)
{
if (index == r)
{
for (int j=0; j<r; j++)
printf("%d ",aux[j]);
printf(", ");
return;
}
if (i >= n)
return;
aux[index] = arr[i];
combination(arr, n, r, index+1, aux, i+1);
combination(arr, n, r, index, aux, i+1);
}
int main()
{
int arr[] = {1, 2,2};
int r = 2;
int n = sizeof(arr)/sizeof(arr[0]);
print(arr, n, r);
return 0;
}
#include<stdio.h>
void combination(int arr[],int n,int r,int index,int aux[],int i);
void print(int arr[], int n, int r)
{
int aux[r];
combination(arr, n, r, 0, aux, 0);
}
void combination(int arr[], int n, int r, int index, int aux[], int i)
{
if (index == r)
{
for (int j=0; j<r; j++)
printf("%d ",aux[j]);
printf(", ");
return;
}
if (i >= n)
return;
aux[index] = arr[i];
combination(arr, n, r, index+1, aux, i+1);
combination(arr, n, r, index, aux, i+1);
}
int main()
{
int arr[] = {1, 2,2};
int r = 2;
int n = sizeof(arr)/sizeof(arr[0]);
print(arr, n, r);
return 0;
}
56. What does the following code do?
#include<stdio.h>
#include<stdlib.h>
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;
temp = temp->next;
}
return 0;
}
int main()
{
int arr[5] = {1,2,3,4,5};
int n = 5,i;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
struct Node *temp;
temp = head;
for(i=0; i<n; i++)
{
struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next = newNode;
temp = temp->next;
}
int ans = linear_search(60);
if(ans == 1)
printf("Found");
else
printf("Not found");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
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;
temp = temp->next;
}
return 0;
}
int main()
{
int arr[5] = {1,2,3,4,5};
int n = 5,i;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
struct Node *temp;
temp = head;
for(i=0; i<n; i++)
{
struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next = newNode;
temp = temp->next;
}
int ans = linear_search(60);
if(ans == 1)
printf("Found");
else
printf("Not found");
return 0;
}
57. Trithemius cipher is harder to crack than caesar cipher.
58. Which of the following takes O(n) time in worst case in array implementation of stack?
59. Every Perfect graph has forbidden graph characterization.
60. The problem of finding a subset of positive integers whose sum is equal to a given positive integer is called as?
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 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