What is the space complexity of Binary Search (iterative implementation)?
O(log n)
O(n log n)
O(1)
O(n)
In the context of Binary Search, what is the problem with searching in an infinitely sized array?
Binary Search cannot handle duplicate elements in an infinitely sized array.
Binary Search requires the entire array to be loaded into memory.
Binary Search cannot handle arrays with no defined end.
Binary Search is too slow for infinitely sized arrays.
In binary search, what happens if the target value is less than the middle element of the current search interval?
The search continues in the left half of the interval.
The middle element is compared with its adjacent elements.
The search continues in the right half of the interval.
The search terminates as the target is not found.
In terms of space complexity, how does the iterative binary search compare to the recursive one?
Iterative binary search generally uses less space.
Both have the same space complexity.
It depends on the size of the input array.
Recursive binary search generally uses less space.
What is the key requirement for Binary Search to work correctly?
The array must be circularly sorted.
The array must have an even number of elements.
The array must be sorted.
The array must have unique elements.
If you need to perform frequent insertions or deletions in the middle of a dataset, is binary search the most suitable choice?
No
Yes
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 requires more memory than 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.
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.
Which of the following is a prerequisite for using binary search on a dataset?
The data must be stored in a linked list.
The data must contain only numerical values.
The data must be stored in a hash table.
The data must be sorted.
In the worst-case scenario, how many comparisons will binary search perform on a sorted array of 16 elements?
8
16
32
4