def test_add_iteravily_will_add_to_tree(): tree = BinarySearchTree() tree.addIteravily(10) tree.addIteravily(15) tree.addIteravily(5) assert tree.root.value == 10 assert tree.root.right.value == 15 assert tree.root.left.value == 5
def new_tree(): new_tree = BinarySearchTree() new_tree.addIteravily(20) new_tree.addIteravily(15) new_tree.addIteravily(25) new_tree.addIteravily(12) new_tree.addIteravily(17) new_tree.addIteravily(23) new_tree.addIteravily(28) return new_tree