Ejemplo n.º 1
0
def test_find_node_in_linked_list_tree():
    root_node = BinaryTree(1)
    root_node.insert(2)
    root_node.insert(3)
    root_node.insert(4)
    root_node.insert(5)

    expected = True
    output = root_node.find(5)
    assert output == expected
Ejemplo n.º 2
0
def test_find_node_not_in_full_tree():
    root_node = BinaryTree(4)
    root_node.insert(2)
    root_node.insert(1)
    root_node.insert(7)
    root_node.insert(5)
    root_node.insert(6)

    expected = False
    output = root_node.find(3)
    assert output == expected
Ejemplo n.º 3
0
def test_find_node_not_in_one_node_tree():
    root_node = BinaryTree(7)

    expected = False
    output = root_node.find(1)
    assert output == expected