computeHeight method

void computeHeight(
  1. BinaryNode node, [
  2. int initHeight = 0
])
inherited

计算树的高度

Implementation

void computeHeight(T node, [int initHeight = 0]) {
  T? tmp = node;
  int h = initHeight;
  do {
    tmp!._height = h;
    tmp = tmp.parent;
  } while (tmp != null && (tmp._height < ++h));
}