an avl tree is a kind of balanced binary search tree in which the two children of each internal node must have heights that differ by at most one. the height of an external node is zero, and the height of any internal node is always one plus the maximum of the heights of its two children. thus, the height function of an avl tree obeys the constraints of a wavl tree, and we may convert any avl tree into a wavl tree by using the height of each node as its rank.