23.
In which of the following case jump search will be preferred over exponential search?

24.
What will be the output 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; 
}

30.
Given an array arr = {45, 77, 89, 90, 94, 99, 100} and key = 99; what are the mid values(corresponding array elements) in the first and second levels of recursion?

Read More Section(Searching Algorithms)

Each Section contains maximum 100 MCQs question on Searching Algorithms. To get more questions visit other sections.