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 left half of the array.
Search the right half of the array.
Search the entire array again.
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 can be used on unsorted data.
Binary search uses less memory.
Can binary search be used to efficiently search for a target value in a rotated sorted array?
Yes, binary search can be directly applied.
It depends on the pivot point of the rotated array.
Yes, but it requires modifications to handle the rotation.
No, binary search is not applicable to rotated sorted arrays.
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
What is the key requirement for Binary Search to work correctly?
The array must be circularly sorted.
The array must have unique elements.
The array must be sorted.
The array must have an even number of elements.
How do you calculate the middle index in Binary Search to avoid potential overflow?
mid = (left + right + 1) / 2
mid = (left + right) / 2
mid = left / 2 + right / 2
mid = left + (right - left) / 2
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 right half of the interval.
The middle element is compared with its adjacent elements.
The search continues in the left half of the interval.
What is the base case in a recursive implementation of binary search?
When the search interval becomes empty.
Both option1 and option2
When the middle element equals the target element.
When the target element is found.
What is the key characteristic of an array that makes Binary Search applicable?
The array must be of a fixed size.
The array must contain only positive integers.
The array must be stored in contiguous memory locations.
What happens if the target element is not present in the array during Binary Search?
It throws an exception.
It returns the index where the element should be inserted.
It returns -1.
It enters an infinite loop.