Exemplo n.º 1
0
 def test_heightRootNodeLeftRightChildren(self):
     tree = AVLTree()
     tree.insert(4)
     tree.insert(3)
     tree.insert(5)
     height = tree.get_height(tree.root)
     self.assertEqual(height, 2)
Exemplo n.º 2
0
 def test_heightRootNode(self):
     tree = AVLTree()
     tree.insert(4)
     height = tree.get_height(tree.root)
     self.assertEqual(height, 1)
Exemplo n.º 3
0
 def test_heightNoRootNode(self):
     tree = AVLTree()
     height = tree.get_height(tree.root)
     self.assertEqual(height, 0)