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.
Search the entire array again.
Search the left half of the array.
Conclude the target is not present.
Which of the following is a key difference between the iterative and recursive approaches to binary search?
Iterative binary search uses a loop, while recursive binary search uses function calls.
Iterative binary search is generally more efficient.
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.
What is the space complexity of Binary Search (iterative implementation)?
O(n)
O(n log n)
O(1)
O(log n)
Can binary search be used to efficiently search for a target value in a rotated sorted array?
No, binary search is not applicable to rotated sorted arrays.
Yes, binary search can be directly applied.
Yes, but it requires modifications to handle the rotation.
It depends on the pivot point of the rotated array.
Which of the following best describes the advantage of binary search over linear search?
Binary search is easier to implement.
Binary search has a faster average-case time complexity.
Binary search can be used on unsorted data.
Binary search uses less memory.
What is the time complexity of Binary Search in the worst-case scenario?
Can Binary Search be used on an unsorted array?
Yes, but it will have a linear time complexity.
No, the array must be sorted for Binary Search to function properly.
Yes, it will still work correctly.
It depends on the implementation of Binary Search.
What is the time complexity of Binary Search in the best-case scenario?
Which of the following is a prerequisite for using binary search on a dataset?
The data must contain only numerical values.
The data must be sorted.
The data must be stored in a linked list.
The data must be stored in a hash table.
What is the base case in a recursive implementation of binary search?
When the middle element equals the target element.
Both option1 and option2
When the search interval becomes empty.
When the target element is found.