示例#1
0
def test_two(dummy_balanced_4levels_tree):
    expected = True
    dummy_balanced_4levels_tree.add(4)

    actual = check_balanced(dummy_balanced_4levels_tree)

    assert actual == expected, 'Error on test_two.'
示例#2
0
def test_tree(dummy_balanced_4levels_tree):
    expected = False
    dummy_balanced_4levels_tree.add(4)
    dummy_balanced_4levels_tree.add(3)

    actual = check_balanced(dummy_balanced_4levels_tree)

    assert actual == expected, 'Error on test_tree.'
示例#3
0
def test_four():
    BST = BinarySearchTree()
    # level 0
    BST.add(100)
    # level 1
    BST.add(50)
    # level 2
    BST.add(25)

    BST.add(15)
    BST.add(40)

    expected = False

    actual = check_balanced(BST)

    assert actual == expected, 'Error on test_four.'
示例#4
0
def test_one(dummy_balanced_4levels_tree):
    expected = True

    actual = check_balanced(dummy_balanced_4levels_tree)

    assert actual == expected, 'Error on test_one.'