Two new ADT interface functions should be added to set and get the height of the root node of a tree. The prototypes of these two functions are
void AVLTree_seth(struct Tree *pT, int h);
|
and
int AVLTree_geth(struct Tree *pT);
|
Both subroutines should not crash if pT points to an empty tree.
Note that AVLTree_seth should not be published, as no one other than the implementor of AVLTree needs to set the size.