Q1
What is the average time complexity of the Binary Search algorithm?
- O(n)
- O(log n)
- O(n log n)
- O(1)
Q2
Which searching algorithm is most suitable for searching in an unsorted list?
- Binary Search
- Linear Search
- Interpolation Search
- Exponential Search
Q3
In what scenario is Interpolation Search preferred over Binary Search?
- When the data is unsorted
- When the data is uniformly distributed
- When the data is non-uniformly distributed
- When searching for the minimum element
Q4
What is the worst-case time complexity of Linear Search?
- O(1)
- O(log n)
- O(n)
- O(n log n)
Q5
Which of the following algorithms requires a sorted dataset?
- Linear Search
- Exponential Search
- Hash Search
- Both Linear and Exponential Search
Q6
What is the space complexity of Binary Search implemented iteratively?
- O(n)
- O(log n)
- O(1)
- O(n log n)
Q7
What is the main advantage of Exponential Search?
- Works on unsorted data
- Works on linked lists
- Suitable for unbounded arrays
- Has better time complexity than binary search
Q8
What happens if you try to perform binary search on an unsorted array?
- It throws an exception
- It returns the correct result
- It may return an incorrect result
- It always returns -1
Q9
Which of the following is a drawback of Interpolation Search?
- High memory usage
- Poor performance with uniformly distributed data
- Susceptible to worst-case O(n) time complexity
- Only works with integer data types
Q10
What is the first step in Exponential Search?
- Sort the array
- Find the range where the element might be present
- Apply binary search on the entire array
- Calculate the middle element
Q11
What is the time complexity of Exponential Search when the element is the first element in the array?
- O(1)
- O(log n)
- O(n)
- O(n log n)
Q12
Which search algorithm benefits most from caching recently accessed elements?
- Binary Search
- Linear Search
- Interpolation Search
- Exponential Search
Q13
In what scenario should you avoid using binary search?
- When memory is severely limited
- When the dataset is very large
- When you know the data is sorted
- When frequent insertions and deletions are required
Q14
What data structure is typically used to implement binary search?
- Linked List
- Hash Table
- Sorted Array
- Binary Tree
Q15
How does Interpolation Search estimate the position of the target value?
- By always checking the middle element.
- Based on the magnitude of difference between the target value and the element values.
- By randomly selecting a position
- By traversing the array linearly