Q.1 Which of the following is a linear search algorithm characteristic?
Searches in sorted data only
Searches sequentially
Uses divide and conquer
Requires a tree structure
Explanation - Linear search checks each element one by one until the target is found or the list ends.
Correct answer is: Searches sequentially
Q.2 What is the worst-case time complexity of linear search?
O(1)
O(n)
O(log n)
O(n log n)
Explanation - In the worst case, linear search checks all n elements, giving O(n) complexity.
Correct answer is: O(n)
Q.3 Binary search requires the input array to be:
Unsorted
Sorted
A linked list
Circular
Explanation - Binary search divides the array based on comparison, which only works correctly if the array is sorted.
Correct answer is: Sorted
Q.4 What is the best-case complexity of binary search?
O(n)
O(log n)
O(1)
O(n log n)
Explanation - The best case occurs when the middle element is the target, requiring only one comparison.
Correct answer is: O(1)
Q.5 Which searching algorithm is most efficient for a small unsorted list?
Binary search
Linear search
Jump search
Exponential search
Explanation - Linear search has minimal overhead and is simple for small unsorted lists.
Correct answer is: Linear search
Q.6 Jump search works efficiently on:
Unsorted lists
Sorted arrays
Linked lists
Trees
Explanation - Jump search jumps ahead by fixed steps in a sorted array to reduce comparisons.
Correct answer is: Sorted arrays
Q.7 What is the time complexity of jump search?
O(n)
O(√n)
O(log n)
O(n log n)
Explanation - Jump search makes √n jumps and then performs a linear search in that block, giving O(√n).
Correct answer is: O(√n)
Q.8 Interpolation search works best when:
Data is uniformly distributed
Data is unsorted
Data is linked list
Data is in tree
Explanation - Interpolation search estimates the position of the target using a formula, which works best with uniform distribution.
Correct answer is: Data is uniformly distributed
Q.9 What is the worst-case time complexity of interpolation search?
O(log n)
O(n)
O(1)
O(n log n)
Explanation - In the worst case, interpolation search can degrade to linear search if data is not uniformly distributed.
Correct answer is: O(n)
Q.10 Exponential search is mainly used with:
Unsorted arrays
Sorted arrays
Linked lists
Graphs
Explanation - Exponential search quickly finds a range where the target may exist in a sorted array, then performs binary search.
Correct answer is: Sorted arrays
Q.11 What is the primary advantage of binary search over linear search?
No need for sorting
Fewer comparisons on large data
Works on linked lists efficiently
Simpler to implement
Explanation - Binary search reduces comparisons significantly by halving the search space each time.
Correct answer is: Fewer comparisons on large data
Q.12 Which algorithm uses a divide-and-conquer approach?
Linear search
Binary search
Jump search
Sequential search
Explanation - Binary search divides the search interval in half at each step, following divide-and-conquer.
Correct answer is: Binary search
Q.13 Fibonacci search is similar to:
Binary search
Linear search
Jump search
Interpolation search
Explanation - Fibonacci search divides the array into sections using Fibonacci numbers and reduces search space like binary search.
Correct answer is: Binary search
Q.14 What is the advantage of jump search over linear search?
Fewer comparisons in sorted arrays
Works on unsorted arrays
No sorting needed
Always O(1) complexity
Explanation - Jump search skips blocks of elements, reducing the number of comparisons in sorted arrays.
Correct answer is: Fewer comparisons in sorted arrays
Q.15 Which search is optimal for infinite-sized sorted lists?
Binary search
Exponential search
Linear search
Jump search
Explanation - Exponential search can find the range quickly and then perform binary search even on very large or conceptually infinite arrays.
Correct answer is: Exponential search
Q.16 In linear search, how many comparisons are needed in the best case?
1
n/2
n
log n
Explanation - The best case occurs when the target element is the first element in the array, requiring only one comparison.
Correct answer is: 1
Q.17 Which search algorithm uses a probe formula to guess the position of the element?
Binary search
Interpolation search
Linear search
Jump search
Explanation - Interpolation search estimates the position of the target element using a formula based on the values at endpoints.
Correct answer is: Interpolation search
Q.18 Which searching algorithm is not suitable for linked lists?
Linear search
Binary search
Sequential search
None of these
Explanation - Binary search requires random access, which is inefficient for linked lists; linear search is better.
Correct answer is: Binary search
Q.19 What is the space complexity of binary search (iterative version)?
O(1)
O(log n)
O(n)
O(n log n)
Explanation - Iterative binary search only uses a few variables for indices, requiring constant extra space.
Correct answer is: O(1)
Q.20 Which search is considered optimal for large sorted arrays in average cases?
Linear search
Binary search
Jump search
Sequential search
Explanation - Binary search halves the search space each time, making it very efficient for large sorted arrays.
Correct answer is: Binary search
Q.21 Which search algorithm is based on dividing search intervals according to Fibonacci numbers?
Binary search
Fibonacci search
Jump search
Interpolation search
Explanation - Fibonacci search uses Fibonacci numbers to divide the array into sections for searching.
Correct answer is: Fibonacci search
Q.22 Which search algorithm is particularly good for sparse arrays?
Linear search
Binary search
Exponential search
Jump search
Explanation - Jump search can efficiently skip large sections, making it suitable for sparse arrays.
Correct answer is: Jump search
Q.23 Time complexity of linear search in best case is:
O(1)
O(n)
O(log n)
O(n log n)
Explanation - If the first element is the target, only one comparison is needed.
Correct answer is: O(1)
Q.24 What kind of search algorithm is sequential search?
Divide and conquer
Incremental search
Heuristic search
Graph search
Explanation - Sequential search checks each element in order, so it is incremental.
Correct answer is: Incremental search
Q.25 Which search is adaptive to the distribution of data?
Linear search
Binary search
Interpolation search
Jump search
Explanation - Interpolation search performs better if the data is uniformly distributed as it can guess the position.
Correct answer is: Interpolation search
