Can Binary Search be used on an unsorted array?
Yes, but it will have a linear time complexity.
Yes, it will still work correctly.
It depends on the implementation of Binary Search.
No, the array must be sorted for Binary Search to function properly.
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.
Iterative binary search is generally more efficient.
Iterative binary search uses a loop, while recursive binary search uses function calls.
Recursive binary search uses a loop, while iterative binary search uses function calls.
In a rotated sorted array [5, 6, 7, 1, 2, 3, 4], what is the pivot element?
7
4
5
1
What value does binary search return if the target element is not present in the sorted array?
Null
Index where the element should be inserted
It depends on the implementation
-1
You need to find the first occurrence of a target value in a sorted array with duplicates. Which algorithm is more efficient?
Binary search
Linear search
Which data structure inherently benefits from the efficiency of binary search for searching operations?
Linked List
Queue
Hash Table
Binary Search Tree
What is the key characteristic of an array that makes Binary Search applicable?
The array must be sorted.
The array must be stored in contiguous memory locations.
The array must be of a fixed size.
The array must contain only positive integers.
What is the key requirement for Binary Search to work correctly?
The array must have unique elements.
The array must have an even number of elements.
The array must be circularly sorted.
In what scenario would linear search be more suitable than binary search?
Finding the median value in a sorted array.
Searching for a specific value in a sorted array.
Searching for an element in a small, unsorted array.
Finding the smallest element in a rotated sorted array.
In the context of Binary Search, what is the problem with searching in an infinitely sized array?
Binary Search cannot handle arrays with no defined end.
Binary Search cannot handle duplicate elements in an infinitely sized array.
Binary Search requires the entire array to be loaded into memory.
Binary Search is too slow for infinitely sized arrays.