[Avl-cvs] avl/src avlt.cpp,1.14,1.15
Brought to you by:
hetfield666,
jah2003
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-17 11:57:43
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7937 Modified Files: avlt.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** avlt.cpp 17 Sep 2004 11:27:36 -0000 1.14 --- avlt.cpp 17 Sep 2004 11:57:34 -0000 1.15 *************** *** 338,342 **** aux = this; ! if(key == getValue()) { //Questi passaggi sono simili a quelli utilizzati per i bst if ( !getLeft() || !getRight() ) --- 338,342 ---- aux = this; ! if(key == this->getValue()) { //Questi passaggi sono simili a quelli utilizzati per i bst if ( !getLeft() || !getRight() ) *************** *** 379,386 **** { ((Avlt *)(aux2->getRight()))->rightRotate(); ! aux2->leftRotate(); } else ! aux2->leftRotate(); else //condizioni simmetriche a sopra if( aux2->getFdb() == 2 ) --- 379,386 ---- { ((Avlt *)(aux2->getRight()))->rightRotate(); ! aux = aux2->leftRotate(); } else ! aux = aux2->leftRotate(); else //condizioni simmetriche a sopra if( aux2->getFdb() == 2 ) *************** *** 388,395 **** { ((Avlt *)(aux2->getLeft()))->leftRotate(); ! aux2->rightRotate(); } else ! aux2->rightRotate(); } }while( aux2 != this && aux2 ); --- 388,395 ---- { ((Avlt *)(aux2->getLeft()))->leftRotate(); ! aux = aux2->rightRotate(); } else ! aux = aux2->rightRotate(); } }while( aux2 != this && aux2 ); *************** *** 403,407 **** if(key < getValue()) //Se il nodo corrente ha valore maggiore di quello da eliminare si va verso sinistra altrimenti verso destra { ! if( getLeft() ) { ((Avlt *)getLeft())->erase( key ); //chiamata ricorsiva --- 403,407 ---- if(key < getValue()) //Se il nodo corrente ha valore maggiore di quello da eliminare si va verso sinistra altrimenti verso destra { ! if( this->getLeft() ) { ((Avlt *)getLeft())->erase( key ); //chiamata ricorsiva *************** *** 419,423 **** else { //operazioni simmetriche a sopra ! if( getRight() ) { ((Avlt *)getRight())->erase( key ); --- 419,423 ---- else { //operazioni simmetriche a sopra ! if( this->getRight() ) { ((Avlt *)getRight())->erase( key ); |