getHeight method

  1. @override
int getHeight()
override

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

Implementation

@override
int getHeight() => _root?.height ?? 0;