def _is_sorted(arr):
    """ Returns `True` if the array is sorted ascendingly and `False if it isn't."""
    i = 0     
    while (i+1 < arr.shape[0]):
        if arr[i] > arr[i+1]:
            return False
        i += 1
    return True