Which data structure inherently benefits from the efficiency of binary search for searching operations?
Binary Search Tree
Hash Table
Queue
Linked List
What is the primary difference between Binary Search and Interpolation Search?
Binary Search only works on sorted arrays, while Interpolation Search can work on unsorted arrays.
Binary Search requires more memory than Interpolation Search.
Binary Search always divides the array in half, while Interpolation Search estimates the position of the target element.
Binary Search is faster than Interpolation Search in all cases.
Which of the following best describes the time complexity of binary search in the average case?
O(n log n)
O(log n)
O(1)
O(n)
In binary search, what happens if the target value is less than the middle element of the current search interval?
The search continues in the right half of the interval.
The middle element is compared with its adjacent elements.
The search continues in the left half of the interval.
The search terminates as the target is not found.
How does Binary Search handle duplicate elements in a sorted array?
It returns the index of the last occurrence of the target element.
It returns the index of any one occurrence of the target element.
It throws an error as Binary Search requires unique elements.
It returns the index of the first occurrence of the target element.
What is the key requirement for Binary Search to work correctly?
The array must be sorted.
The array must be circularly sorted.
The array must have an even number of elements.
The array must have unique elements.
How do you calculate the middle index in Binary Search to avoid potential overflow?
mid = (left + right) / 2
mid = left / 2 + right / 2
mid = left + (right - left) / 2
mid = (left + right + 1) / 2
You have a sorted array that has been rotated an unknown number of times. Which algorithm is best suited for finding a specific element in this array?
Interpolation Search
Jump Search
Linear Search
Binary Search
You have an unsorted array, and you need to find a specific value. Is it more efficient to sort the array and then use binary search, or to directly apply linear search?
Directly use linear search
Sort and then use binary search
What is the space complexity of Binary Search (iterative implementation)?