getHeight method

int getHeight ()
override

Compute the height of the binary tree in O(N) time. Should not be called often.

@return

Implementation

int getHeight() {
  if (_root == NULL_NODE) {
    return 0;
  }
  return _height[_root];
}