Example #1
0
def test__BST_remove_and_insert2(xs, ys):
    '''
    This test performs a mixture of both insertions and removals.
    This ensures that there are no weird interactions between inserting and removing.
    '''
    xs = list(set(xs))
    bst = BST(xs)
    for y in ys:
        bst.insert(y)
        x = bst.find_largest()
        bst.remove(x)
        assert bst.is_bst_satisfied()
Example #2
0
def test__BST_find_largest(xs):
    xs = list(set(xs))
    if len(xs) > 0:
        x = max(xs)
        bst = BST(xs)
        assert x == bst.find_largest()