Can binary search be used to efficiently search for a target value in a rotated sorted array?
Yes, but it requires modifications to handle the rotation.
It depends on the pivot point of the rotated array.
Yes, binary search can be directly applied.
No, binary search is not applicable to rotated sorted arrays.
In the worst-case scenario, how many comparisons will binary search perform on a sorted array of 16 elements?
8
32
4
16
What is the primary difference between Binary Search and Interpolation Search?
Binary Search requires more memory than Interpolation Search.
Binary Search only works on sorted arrays, while Interpolation Search can work on unsorted arrays.
Binary Search is faster than Interpolation Search in all cases.
Binary Search always divides the array in half, while Interpolation Search estimates the position of the target element.
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
In Binary Search, if the target value is less than the middle element, what should be the next step?
Conclude the target is not present.
Search the entire array again.
Search the right half of the array.
Search the left half of the array.
Can Binary Search be used on an unsorted array?
It depends on the implementation of Binary Search.
Yes, it will still work correctly.
Yes, but it will have a linear time complexity.
No, the array must be sorted for Binary Search to function properly.
What value does binary search return if the target element is not present in the sorted array?
It depends on the implementation
Index where the element should be inserted
Null
-1
In what scenario would linear search be more suitable than binary search?
Searching for an element in a small, unsorted array.
Searching for a specific value in a sorted array.
Finding the median value in a sorted array.
Finding the smallest element in a rotated sorted array.
What is the base case in a recursive implementation of binary search?
When the search interval becomes empty.
When the middle element equals the target element.
When the target element is found.
Both option1 and option2
What is the time complexity of Binary Search in the best-case scenario?
O(n log n)
O(log n)
O(n)
O(1)