Here is the Python code that implements the binary search algorithm:
```
def binary_search(arr, target):
    low = 0
    high = len(arr) - 1

    while low <= high:
        mid = (low + high) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            low = mid + 1
        else:
            high = mid - 1

    return -1  # not found
```
Here's an explanation of how the code works:

1. We initialize two variables `low` and `high` to represent the range of indices we need to search. Initially, `low` is 0 and `high` is the length of the array minus 1.
2. We loop until `low` is greater than `high`.
3. In each iteration, we calculate the midpoint `mid` of the range using the formula `(low + high) // 2`.
4. We compare the value at the midpoint `arr[mid]` with the target value `target`.
5. If they are equal, we return the midpoint index.
6. If `arr[mid]` is less than `target`, we know that the target value must be in the second half of the range, so we set `low` to `mid + 1`.
7. If `arr[mid]` is greater than `target`, we know that the target value must be in the first half of the range, so we set `high` to `mid - 1`.
8. If the loop ends without finding the target value, we return -1 to indicate that it was not found.

As for your question, this algorithm is called **Binary Search**. It's a classic algorithm for finding an element in a sorted array, and it has a time complexity of O(log n), making it much faster than a linear search (which has a time complexity of O(n)) for large arrays.