from typing import List


def binary_search(alst: List, target):
    """二分查找"""
    first = 0
    last = len(alst) - 1

    while first <= last:
        midpoint = (first + last) // 2
        if alst[midpoint] == target:
            return True
        elif target > alst[midpoint]:
            first = midpoint + 1
        elif target < alst[midpoint]:
            last = midpoint - 1

    return False