def test_removing_min_until_empty(self): initialization_list = [100, 75, 125, -30, 150, 40, 20, 130] tree = BSTree(initialization_list) removed_values = [] while tree.size > 0: min_value = tree.min() removed_values.append(min_value) tree.remove(min_value) self.assertEqual(removed_values, sorted(initialization_list))
def test_min_value(self): tree = BSTree([100, 75, 125, 150, -40]) self.assertEqual(tree.min(), -40)