What is the time complexity of Binary Search in the worst-case scenario?
O(n log n)
O(log n)
O(n)
O(1)
In the worst-case scenario, how many comparisons will binary search perform on a sorted array of 16 elements?
16
8
32
4
Which of the following is a key difference between the iterative and recursive approaches to binary search?
Recursive binary search can only be used on arrays, while iterative binary search can be used on any data structure.
Recursive binary search uses a loop, while iterative binary search uses function calls.
Iterative binary search is generally more efficient.
Iterative binary search uses a loop, while recursive binary search uses function calls.
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?
Linear Search
Jump Search
Interpolation 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?
Sort and then use binary search
Directly use linear search
Which of the following best describes the time complexity of binary search in the average case?
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.
No, binary search is not applicable to rotated sorted arrays.
Yes, binary search can be directly applied.
It depends on the pivot point of the rotated array.
In terms of space complexity, how does the iterative binary search compare to the recursive one?
Both have the same space complexity.
It depends on the size of the input array.
Recursive binary search generally uses less space.
Iterative binary search generally uses less space.
Which of the following best describes the advantage of binary search over linear search?
Binary search uses less memory.
Binary search is easier to implement.
Binary search has a faster average-case time complexity.
Binary search can be used on unsorted data.
In binary search, what happens if the target value is less than the middle element of the current search interval?
The search terminates as the target is not found.
The search continues in the left half of the interval.
The search continues in the right half of the interval.
The middle element is compared with its adjacent elements.