Ejemplo n.º 1
0
 def test_Have_two_levels_and_search(self):
     bst = BinarySearchTree(20)
     appendee = BinarySearchTree(21)
     appendee2 = BinarySearchTree(22)
     bst.append(appendee)
     bst.append(appendee2)
     self.assertEqual(appendee2, appendee.right)
Ejemplo n.º 2
0
 def test_If_bigger_put_into_right(self):
     bst = BinarySearchTree(3)
     appendee = BinarySearchTree(15)
     bst.append(appendee)
     self.assertEqual(bst.right, appendee)
Ejemplo n.º 3
0
 def test_initially_substantiates_children_to_the_left(self):
     bst = BinarySearchTree(30)
     appendee = BinarySearchTree(15)
     bst.append(appendee)
     self.assertEqual(bst.left, appendee)