We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Height

Our DevOps team has been concerned with the hardware required to run the software using our BST. In an effort to diagnose the issue, they've asked us to write a method that returns the height of the tree. For example, this tree:

    > Elrond#3
> Elian#2
    > Astram#1

Has a height of 2 because the longest path from the root node to a leaf node is 2 nodes long.

Assignment

Complete the height method. It returns the height of the tree rooted at the current node.