/** * Double rotate binary tree node: first left child. * with its right child; then node k3 with new left child. * For AVL trees, this is a double rotation for case 2. * Update heights, then set new root. */ template void AvlTree:: doubleWithLeftChild( AvlNode * & k3 ) const { rotateWithRightChild( k3->left ); rotateWithLeftChild( k3 ); } /** * Double rotate binary tree node: first right child. * with its left child; then node k1 with new right child. * For AVL trees, this is a double rotation for case 3. * Update heights, then set new root. */ template void AvlTree:: doubleWithRightChild( AvlNode * & k1 ) const { rotateWithLeftChild( k1->right ); rotateWithRightChild( k1 ); }