Finding the levels of a Binary tree

From: JC (keepit_at_secret.com)
Date: 11/29/03


Date: Sat, 29 Nov 2003 16:11:22 -0500

Hello,

Does anyone know how to get the level(s) in a binary tree.

For example:

               (60) Level 0
              / \
          (50) (65) Level 1
          / \ \
        (49) (55) (68) Level 2
                                \
                                (71) Level 3

I tried counting all the "left" or "right" leaves but that doesn't work.
because of children.

Any help would be greatly appreciated.
JC