Binary search is used to search a key element from multiple elements. Binary search is faster than linear search.
In case of binary search, array elements must be in ascending order. If you have unsorted array, you can sort the array using Arrays.sort(arr) method.
BrindhaPrathaban Answered question
