Height of a Binary TreeEasy
The height of a binary tree is the maximum number of edges between the root and its leaf nodes.
Given a binary tree root, calculate the height of the tree.
For example, let's say you're given the following binary tree:
The height is
2since leaf nodes -4, 7, and 8 are 2 edges away from the root.