コード例 #1
0
ファイル: avltree.cpp プロジェクト: Bartleby2718/pdr
/**
* 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.
*/
void AvlTree::doubleWithRightChild( AvlNode * & k1 ) const {
    rotateWithLeftChild( k1->right );
    rotateWithRightChild( k1 );
}
コード例 #2
0
ファイル: bintree.cpp プロジェクト: fbardelli/compsci
/*
 *    Double rotate binary tree: first left child
 *       with its right child; then node k3 with new left child.
 *          Update heights, then set new root.
 *          */
void doubleWithLeftChild( AvlNode * & k3 )
{
   rotateWithRightChild( k3->left );
   rotateWithLeftChild( k3 );
}
コード例 #3
0
ファイル: avltree.cpp プロジェクト: Bartleby2718/pdr
/**
* 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.
*/
void AvlTree::doubleWithLeftChild( AvlNode * & k3 ) const {
    rotateWithRightChild( k3->left );
    rotateWithLeftChild( k3 );
}