def insert()

in multiset_codec/msbst.py [0:0]


def insert(multiset, x):
    '''Inserts a symbol x into the multiset'''
    size, y, left, right = multiset or (0, x, (), ())
    if x < y:
        left = insert(left, x)
    elif x > y:
        right = insert(right, x)
    return size + 1, y, left, right