 If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found.If the search ends with the remaining half being empty, the target is not in the array.Binary search runs in logarithmic time in the worst case, making formula_1 comparisons, where formula_2 is the number of elements in the array, the formula_3 is Big O notation, and formula_4 is the logarithm.