If we have an array that is sorted, we can use a much more efficient algorithm called a Binary Search.
In binary search each time we divide array into two equal half and compare middle element with search element.
If middle element is equal to search element then we got that element and return that index otherwise if middle element is less than search element we look right part of array and if middle element is greater than search element we look left part of array.