Checking every element of a sorted array wastes the order you already have. Binary search halves the range each step, so it finds a value among a million in about 20 checks. Use it whenever the array is sorted, and also for questions like the first position of a value or the smallest answer that works. It gives wrong answers on unsorted data, so sort first or choose a different approach.