In Binary Search, if the target value is less than the middle element, what should be the next step?
Search the right half of the array.
Conclude the target is not present.
Search the entire array again.
Search the left half of the array.
Which of the following best describes the advantage of binary search over linear search?
Binary search has a faster average-case time complexity.
Binary search is easier to implement.
Binary search uses less memory.
Binary search can be used on unsorted data.
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
What is the primary difference between Binary Search and Interpolation Search?
Binary Search is faster than Interpolation Search in all cases.
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.
What is the space complexity of Binary Search (iterative implementation)?
O(n)
O(1)
O(log n)
O(n log n)
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 uses a loop, while recursive binary search uses function calls.
Iterative binary search is generally more efficient.
In the worst-case scenario, how many comparisons will binary search perform on a sorted array of 16 elements?
32
16
4
8
In a rotated sorted array [5, 6, 7, 1, 2, 3, 4], what is the pivot element?
7
1
5
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
Binary Search
Linear Search
Jump Search
What is the time complexity of Binary Search in the best-case scenario?