def check_if_bst(root, min, max):
    """Given a binary tree, check if it follows binary search tree property
    To start off, run `check_if_bst(BT.root, -math.inf, math.inf)`"""
    if root == None:
        return True

    if root.key < min or root.key >= max:
        return False

    return check_if_bst(root.left, min, root.key) and check_if_bst(
        root.right, root.key, max
    )