Trees: Difficult

Code Writing

Write out a function that will take in a list of unique values and create a binary search tree out of it.
def make_bst(lst):
    if lst == []:
        return ______
    label = lst[0]
    if ______:
        return BTree(label)
    less, greater = [], []
    for elem in lst:
        if ______:
            ______
        else:
            ______
    left = ______
    right = ______
    return BTree(label, left, right)

Write out a function that will take in a sorted list of unique elements and create a balanced binary search tree out of it. You may want to define the given function, find_median_index to help you.
def make_balanced_bst(sorted_lst):
    if sorted_lst == []:
        return ______
    else if ______:
        return ______
    median_index = find_median_index(______)
    label = ______
    left = ______
    right = ______
    return BTree(label, left, right)
def find_median_index(lst):
    return ______