Exemple #1
0
 def test_predecessor_when_predecessor_is_in_left_subtree(self):
     node_90 = create_tree_for_testing_predecessor()
     tree = AVL(node_90)
     expect(tree.get_predecessor(tree.search(150))).to.be.equal(
         tree.get_root().get_right_child().get_left_child().get_right_child(
         ).get_right_child())
Exemple #2
0
 def test_predecessor_when_succesor_is_the_first_turn_going_up(self):
     node_90 = create_tree_for_testing_predecessor()
     tree = AVL(node_90)
     expect(tree.get_predecessor(tree.search(140))).to.equal(node_90)
Exemple #3
0
 def test_predecessor_when_there_is_none(self):
     node_90 = create_tree_for_testing_predecessor()
     tree = AVL(node_90)
     expect(tree.get_predecessor(tree.search(50))).to.be.equal(None)