previous | start | next

Minimum height of a binary tree with L leaves

  Height       maximum number of leaves            Tree
    0                   1                           x

    1                   2                           n
                                                   / \
                                                  x   x

    2                   4                            n
                                                   /   \
                                                  n     n
                                                 / \   / \
                                                x   x x   x

    3                   8                            ...

    h                   2h
   
   

So if a binary tree has L leaves, and is of height h, then L must be less than or equal to the maximum number of leaves possible for a tree of that height:

      
 L <= 2h

or
 
 log(L) <= h
   

If a binary tree has L leaves, the height must be at least log(L).



previous | start | next