The necessary condition for using binary search in an array is :-

2016

The necessary condition for using binary search in an array is :-

  1. A.

    The array should not be too long

  2. B.

    The array should of more size

  3. C.

    The array should be sorted 

  4. D.

    None of these

Attempted by 406 students.

Show answer & explanation

Correct answer: C

Binary search is an efficient algorithm for finding a target value within a list. However, it relies on the assumption that the elements are arranged in order (sorted). If the array is not sorted, binary search cannot correctly eliminate half of the remaining elements at each step. Therefore, the necessary condition for using binary search is that the array must be sorted.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro