コード例 #1
0
def test_add_and_search(size, step):
    tree = Tree()
    for element in range(0, size, step):
        tree.add(element)
    for element in range(0, size, step):
        assert tree.search(element)
    for element in range(10000, 10010):
        assert not tree.search(element)
コード例 #2
0
def test_add_and_order(size, step):
    tree = Tree()
    for element in range(0, size, step):
        tree.add(element)
    assert tree.inorder() == list(range(0, size, step))