コード例 #1
0
 def test_balance_left(self):
     #Left Heavy Tree
     Tree = bst.create_unbalanced_tree(7, left_heavy=True)
     self.assertEqual(Tree.balance(), 6)
コード例 #2
0
 def test_balance_right(self):
     #Right Heavy Tree
     Tree = bst.create_unbalanced_tree(7)
     self.assertEqual(Tree.balance(), -6)
コード例 #3
0
 def test_depth_unbalanced(self):
     #Unbalanced Tree
     Tree = bst.create_unbalanced_tree(7)
     self.assertEqual(Tree.depth(), 6)