Vidyalelo
Data Structure · all questions

Searching Algorithms
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

132

Questions

6/7

Page

Pick an option on a question to see the right answer and solution.

Which of the following searching algorithm is fastest?

Select an option to see the answer and solution.

Interpolation search performs better than binary search when?

Select an option to see the answer and solution.

What is the formula used for calculating the position in interpolation search?
(x = element being searched, A[] = input array, low and high are the leftmost and rightmost index of A[] respectively)

Select an option to see the answer and solution.

Jumps are made in the jump search algorithm until . . . . . . . .

Select an option to see the answer and solution.

What is the best case for linear search?

Select an option to see the answer and solution.

What will be the auxiliary space 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; 
}

Select an option to see the answer and solution.

Linear search(recursive) algorithm used in . . . . . . . .

Select an option to see the answer and solution.

In which of the following case jump search performs better than interpolation search?

Select an option to see the answer and solution.

Best case of jump search will have time complexity of . . . . . . . .

Select an option to see the answer and solution.

What are the updated values of high and low in the array if the element being searched is greater than the value at calculated index in interpolation search? (pos = current position)

Select an option to see the answer and solution.

What is the time complexity of interpolation search when the input array has uniformly distributed values and is sorted?

Select an option to see the answer and solution.

What is the time complexity of exponential sort?

Select an option to see the answer and solution.

What is the recurrence relation for the linear search recursive algorithm?

Select an option to see the answer and solution.

Which algorithmic technique does Fibonacci search use?

Select an option to see the answer and solution.

Interpolation search is a variation of?

Select an option to see the answer and solution.

Jump search algorithm requires which of the following condition to be true?

Select an option to see the answer and solution.

Jump search has a worst case time complexity of O(n).

Select an option to see the answer and solution.

Choose the incorrect statement about exponential search from the following.

Select an option to see the answer and solution.

Where is linear searching used?

Select an option to see the answer and solution.

Exponential search algorithm requires which of the following condition to be true?

Select an option to see the answer and solution.