What is the key characteristic of an array that makes Binary Search applicable?
The array must contain only positive integers.
The array must be sorted.
The array must be stored in contiguous memory locations.
The array must be of a fixed size.
What is the key requirement for Binary Search to work correctly?
The array must have unique elements.
The array must be circularly sorted.
The array must have an even number of elements.
What happens if the target element is not present in the array during Binary Search?
It enters an infinite loop.
It throws an exception.
It returns -1.
It returns the index where the element should be inserted.
In what scenario would linear search be more suitable than binary search?
Searching for a specific value in a sorted array.
Finding the smallest element in a rotated sorted array.
Finding the median value in a sorted array.
Searching for an element in a small, unsorted array.
In terms of space complexity, how does the iterative binary search compare to the recursive one?
Iterative binary search generally uses less space.
It depends on the size of the input array.
Both have the same space complexity.
Recursive binary search generally uses less space.
Which of the following best describes the time complexity of binary search in the average case?
O(n log n)
O(n)
O(1)
O(log n)
What value does binary search return if the target element is not present in the sorted array?
It depends on the implementation
-1
Index where the element should be inserted
Null
What is the time complexity of Binary Search in the worst-case scenario?
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.
What is the primary difference between Binary Search and Interpolation Search?
Binary Search always divides the array in half, while Interpolation Search estimates the position of the target element.
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 is faster than Interpolation Search in all cases.