Skip to main content
2 of 5
edited tags
Raphael
  • 73.4k
  • 31
  • 184
  • 406

Effective finding height of avl tree

I am searching effective way to find out height of AVL tree. In each node there is balance factor ($bf$). $$bf(root)=height(root.left) - height(root.right). $$
And now we can find height in $O(\log n)$ time in a following recursive way:

when bf = 0 choose left or right subtree. when bf = 1 choose left subtree. when bf = -1 choose right subtree. 

The question is: If there exists more effective way ?

user40545
  • 583
  • 6
  • 19