ExamVeda
Login
Home
91
Which of the following is a disadvantage of linear search?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
92
What is the advantage of recursive approach than an iterative approach?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
Which of the following is the most desirable condition for interpolation search?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
94
Given delta[4] is a global array and number of elements in the sorted array is 10, what are the values in the delta array?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
95
Which of the following false about Jump Search?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
96
Which of the following is not an application of binary search?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
97
In which of the following case jump search will be preferred over binary search?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
98
The array is as follows: 1, 2, 3, 6, 8, 10. Given that the number 17 is to be searched. At which call it tells that there's no such element? (By using linear search(recursive) algorithm)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
99
What will be the worst case time complexity of the following code?
#include<bits/stdc++.h> 
using namespace std; 
 
void func(char* str2, char* str1) 
{ 
	int m = strlen(str2); 
	int n = strlen(str1); 
	for (int i = 0; i <= n - m; i++) 
        { 
		int j; 
 
 
		for (j = 0; j < m; j++) 
			if (str1[i + j] != str2[j]) 
				break; 
 
		if (j == m) 
			cout << i << endl; 
	} 
} 
 
int main() 
{ 
	char str1[] = "1253234"; 
	char str2[] = "323"; 
	func(str2, str1); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
100
What will be the best case time complexity of the following code?
#include<bits/stdc++.h> 
using namespace std; 
void func(char* str2, char* str1) 
{ 
	int m = strlen(str2); 
	int n = strlen(str1); 
 
	for (int i = 0; i <= n - m; i++) 
        { 
		int j; 
 
 
		for (j = 0; j < m; j++) 
			if (str1[i + j] != str2[j]) 
				break; 
 
		if (j == m) 
			cout << i << endl; 
	} 
} 
 
int main() 
{ 
	char str1[] = "1253234"; 
	char str2[] = "323"; 
	func(str2, str1); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board