41. Let A={1, 2, 3} B={2, 3, 4} C={1, 3, 5} D={2, 3}. Find the cardinality of sum of all the sets.
42. What is the output of the following code?
#include<stdio.h>
int get_max_element(int *arr,int n)
{
int i, max_element = arr[0];
for(i = 1; i < n; i++)
if(arr[i] > max_element)
max_element = arr[i];
return max_element;
}
int get_min_element(int *arr, int n)
{
int i, min_element = arr[0];
for(i = 1; i < n; i++)
if(arr[i] < min_element)
min_element = arr[i];
return min_element;
}
int main()
{
int n = 7, arr[7] = {5,2,4,7,8,1,3};
int max_element = get_max_element(arr,n);
int min_element = get_min_element(arr,n);
printf("%d %d",max_element,min_element);
return 0;
}
#include<stdio.h>
int get_max_element(int *arr,int n)
{
int i, max_element = arr[0];
for(i = 1; i < n; i++)
if(arr[i] > max_element)
max_element = arr[i];
return max_element;
}
int get_min_element(int *arr, int n)
{
int i, min_element = arr[0];
for(i = 1; i < n; i++)
if(arr[i] < min_element)
min_element = arr[i];
return min_element;
}
int main()
{
int n = 7, arr[7] = {5,2,4,7,8,1,3};
int max_element = get_max_element(arr,n);
int min_element = get_min_element(arr,n);
printf("%d %d",max_element,min_element);
return 0;
}
43. Beaufort cipher and variant beaufort cipher are same ciphers.
44. What is the time complexity of the above recursive implementation of binary search?
45. How many 2*2 matrices are used in this problem?
46. The sum and composition of two polynomials are always polynomials.
47. Consider the following number of activities with their start and finish time given below. In which sequence will the activity be selected in order to maximize the number of activities, without any conflicts?
Activity
Starting time
Finish time
A1
1
2
A2
2
5
A3
1
5
A4
3
6
A5
6
8
A6
4
9
Activity | Starting time | Finish time |
A1 | 1 | 2 |
A2 | 2 | 5 |
A3 | 1 | 5 |
A4 | 3 | 6 |
A5 | 6 | 8 |
A6 | 4 | 9 |
48. Cross product of two vectors can be used to find?
49. Consider the following recursive implementation of linear search:
#include<stdio.h>
int recursive_search_num(int *arr, int num, int idx, int len)
{
if(idx == len)
return -1;
if(arr[idx] == num)
return idx;
return __________;
}
int main()
{
int arr[5] ={1,3,3,3,5},num=2,len = 5;
int indx = recursive_search_num(arr,num,0,len);
printf("Index of %d is %d",num,indx);
return 0;
}
Which of the following recursive calls should be added to complete the above code?
#include<stdio.h>
int recursive_search_num(int *arr, int num, int idx, int len)
{
if(idx == len)
return -1;
if(arr[idx] == num)
return idx;
return __________;
}
int main()
{
int arr[5] ={1,3,3,3,5},num=2,len = 5;
int indx = recursive_search_num(arr,num,0,len);
printf("Index of %d is %d",num,indx);
return 0;
}
Which of the following recursive calls should be added to complete the above code?50. What will be the plain text corresponding to ciphered text "MAO" if atbash cipher is used for encryption?
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 11