computeHeight method
计算树的高度
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));
}
计算树的高度
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));
}