def test_in_order(): tree = BinarySearchTree() tree.add('A') tree.add('B') tree.add('C') actual = tree.in_order() excepted = ['A', 'B', 'C'] assert actual == excepted
def test_in_order(): fruits = BinarySearchTree() fruits.add('bananas') fruits.add('apples') fruits.add('carrots') fruits.add('mango') fruits.add('pear') fruits.add('cake') fruits.add('cookies') fruits.add('beer') fruits.add('whiskey') expected = [ 'apples', 'bananas', 'beer', 'cake', 'carrots', 'cookies', 'mango', 'pear', 'whiskey' ] actual = fruits.in_order() assert expected == actual