61. What is co-ordinate compression?
62. What is the time complexity of 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 recursive_search_num(arr, num, idx+1, len);
}
int main()
{
int arr[8] ={1,2,3,3,3,5,6,7},num=5,len = 8;
int indx = recursive_search_num(arr,num,0,len);
printf("Index of %d is %d",num,indx);
return 0;
}
#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 recursive_search_num(arr, num, idx+1, len);
}
int main()
{
int arr[8] ={1,2,3,3,3,5,6,7},num=5,len = 8;
int indx = recursive_search_num(arr,num,0,len);
printf("Index of %d is %d",num,indx);
return 0;
}
63. What is the result of the recurrences which fall under third case of Master's theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc?
64. What is the time complexity of the following recursive implementation used to find the sum of the first n natural numbers?
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = 5;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = 5;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}
65. Which among the following is the worst case time complexity for deleting an element in coalesced hashing?
66. Minimum number of unique colors required for vertex coloring of a graph is called?
67. Consider the following iterative implementation to find the sum of digits of a number:
#include<stdio.h>
int sum_of_digits(int n)
{
int sm = 0;
while(n != 0)
{
_________;
n /= 10;
}
return sm;
}
int main()
{
int n = 1234;
int ans = sum_of_digits(n);
printf("%d",ans);
return 0;
}
Which of the following lines should be inserted to complete the above code?
#include<stdio.h>
int sum_of_digits(int n)
{
int sm = 0;
while(n != 0)
{
_________;
n /= 10;
}
return sm;
}
int main()
{
int n = 1234;
int ans = sum_of_digits(n);
printf("%d",ans);
return 0;
}
Which of the following lines should be inserted to complete the above code?68. In the random page replacement algorithm, if the current page doesn't exist in the frame then it is replaced with which of the following page?
69. When a free man proposes to an available woman, which of the following happens?
70. Consider the following iterative implementation to find the length of the string:
#include<stdio.h>
int get_len(char *s)
{
int len = 0;
while(________)
len++;
return len;
}
int main()
{
char *s = "harsh";
int len = get_len(s);
printf("%d",len);
return 0;
}
Which of the following lines should be inserted to complete the above code?
#include<stdio.h>
int get_len(char *s)
{
int len = 0;
while(________)
len++;
return len;
}
int main()
{
char *s = "harsh";
int len = get_len(s);
printf("%d",len);
return 0;
}
Which of the following lines should be inserted to complete the above code?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 11
- Miscellaneous on Data Structures - Section 12