fun height(): Int
(source)
Recursive function calculating the height of this tree.
The height of a node is the number of edges on the longest path from the node to a leaf. A leaf node will have a height of 0. The height of a tree would be the height of its root node.
Example: Each node displays the height of the subtree rooted at that node.
3
/ \
1 2
/ \ \
0 0 1
/
0
Return
The height of this tree.