CUET PG 2026 — DSA PYQ
CUET PG | DSA | 2026What is the essential prerequisite for applying Binary Search on a collection of elements?
Choose the correct answer:
- A.
The collection must be sorted and allow random access (O(1) index lookups).
(Correct Answer) - B.
The collection must be stored as a doubly linked list.
- C.
All elements must be strictly positive integers.
- D.
The collection size must be a power of 2.
The collection must be sorted and allow random access (O(1) index lookups).
Explanation
Binary Search works on the divide-and-conquer principle:
Sorted Collection: The collection must be sorted so that comparing the target element with the middle element determines whether to search in the left half or the right half.
Random Access (O(1) lookup): Efficient Binary Search relies on jumping directly to the middle element at index ⌊2low+high⌋ in O(1) time (such as in an array). Without random access (e.g., in linked lists), finding the middle element takes O(N) time, which negates the logarithmic efficiency of binary search.
Therefore, the essential prerequisite is that the collection must be sorted and support random access (O(1) index lookups).
Correct Answer: (A) The collection must be sorted and allow random access (O(1) index lookups).
