previous | start | next

Upper Bound for the Height of an AVL tree

Let h be the maximum height for an AVL tree with N nodes. Then f(h) must be <= N.

  2h/2 < f(h) <= N

Taking log2 we get

      h/2 < log2(N)

      or

      h < 2log2(N)


   

So the height of an AVL tree with N nodes is O(log(N)).



previous | start | next