Binary search is a search algorithm that finds the position of a target value within a sorted array. It compares the target value to the middle element of the array. Therefore, if they are unequal, the search continues on the remaining half until it is successful or the remaining half is empty.
Solutions A and B are explanations to the Binary Search described above. Choose the solution that gives a faster output and explain why.