Tag: binary search
Questions Related to binary search
-
sorted
-
unsorted
-
in a heap
-
popped out of stack
Correct Option: A
Explanation:
The correct answer is A. sorted. For a binary search algorithm to work correctly, the array (or list) must be sorted in ascending or descending order. This allows the algorithm to efficiently divide the search space in half at each step, reducing the number of elements to be searched. If the array is unsorted, the binary search algorithm may not produce the correct results.