previous | start | next

Height of 2-3 Tree

A 2-3 tree is always perfectly balanced: For every Node, the height of its left subtree is the same as the height of the right subtree.

This guarantees that for a 2-3 tree with N nodes, and height h:

      N = 2(h + 1) - 1
   

So

 
      h = log2(N + 1) - 1 <= log2(N)
   

Note that N is the number of nodes, not necessarily the number of keys since each node can contain either 1 or 2 keys.



previous | start | next