def walk_up(arr, start_pos):
    """
    Performs a greedy search for a local maximum of :param:`arr` from the given :param:`start_pos`.
    """
    cur_pos = start_pos
    if arr[cur_pos - 1] > arr[cur_pos + 1]:
        while cur_pos >= 0:
            if arr[cur_pos - 1] > arr[cur_pos]:
                cur_pos -= 1
            else:
                break
    else:
        while cur_pos < len(arr):
            if arr[cur_pos + 1] > arr[cur_pos]:
                cur_pos += 1
            else:
                break
    return cur_pos
