Computer Applications

Why does Binary Search need a sorted array to perform the search operation?

Java Arrays

9 Likes

Answer

In Binary Search, the array is repeatedly divided into two halves and the element is searched in that half whose last element is greater than or equal to the element being searched. For this reason, Binary Search needs a sorted array to perform the search operation.

Answered By

7 Likes


Related Questions