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
Explain the technique of Bubble Sort with an example.
How does the binary search find the presence of an element quicker than the linear search?
Explain the technique of Selection Sort with an example.
Write a program to input integer elements into an array of size 20 and perform the following operations:
- Display largest number from the array
- Display smallest number from the array
- Display sum of all the elements of the array