The usual solution to find the height of a binary tree follows the recursive algorithm shown below: if node == null: return 0 else return max(height(node.left), height(node.right)) + 1 The usual algorithm won't help you if you are dealing with non binary trees. So, here's an alternate way of finding height of a tree. For purpose of demonstration, I am using a binary tree, but as I detail in conclusion, this applies to non-binary trees as well. First, add an additional attribute to your node called ......