Binary search is run on a sorted array of \(8\) distinct elements. Each comparison checks whether the middle element of the current range is equal to, less than, or greater than the key. The maximum number of comparisons that may be needed is .
Curated · Linear Search & Binary Search
Solve it on GATE DA practice →More Searching & Sorting Algorithms problems