previous | start | next

AVL Trees

AVL trees are Binary Search Trees with the additional property that the methods maintain a "balanced" property:

      For every node in an AVL tree, the heights of its children differ by
      at most 1.
   

For the purpose of this definition (and also the implementation), an empty child will be considered to be at height -1.

The AVL tree below shows the height of each node.

      The children of 600 have heights 

      0 (left child 550) and
      -1 (right child empty).

      and these differ by only 1.
   


previous | start | next