previous | start | next

Order of growth of AVL Tree methods

For a binary search tree (which includes AVL trees), the order of growth of the put, get, delete, min, max, floor, ceiling, rank, and select methods all are determined by the height the tree.

Fact:

For an AVL tree, the height = O(log(N)), where N is the number of keys.

This follows from the fact that if an AVL tree has height h, the number of keys, N, can't be too small. More precisely,

      N >= 2h / 2
   

Solving for h, this means

      h / 2 <= log(N)
   

So

      h <= 2log(N)
   

(See the appendix below for the details.)



previous | start | next