def test_find_max_in_bst_all_neg(): t = BinaryTreeSearch() t.add(-5) t.add(-9) t.add(-4) t.add(-14) t.add(-7) t.add(-6) t.add(-3) actual = t.find_maximum_value() expected = -3 assert actual == expected
def test_find_max_in_non_bst_w_neg(): t = BinaryTreeSearch() t.add(5) t.add(9) t.add(4) t.add(22) t.add(7) t.add(6) t.add(-3) actual = t.find_maximum_value() expected = 22 assert actual == expected
def test_find_max_in_bst(): t = BinaryTreeSearch() t.add(5) t.add(9) t.add(4) t.add(14) t.add(7) t.add(6) t.add(3) actual = t.find_maximum_value() expected = 14 assert actual == expected
def test_find_max_in_non_bst_left(): t = BinaryTreeSearch() t.add(5) t.add(9) t.add(4) t.add(14) t.add(7) t.add(6) t.add(3) t.add(2) t.root.left_node.left_node.left_node.value = 16 actual = t.find_maximum_value() expected = 16 assert actual == expected