[Avl-cvs] avl/src avl.cpp,1.12,1.13 bst.cpp,1.11,1.12
Brought to you by:
hetfield666,
jah2003
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-07 11:53:24
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6933 Modified Files: avl.cpp bst.cpp Log Message: Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** bst.cpp 6 Sep 2004 14:12:06 -0000 1.11 --- bst.cpp 7 Sep 2004 11:53:10 -0000 1.12 *************** *** 180,187 **** { if ( key == aux1->getValue() ) - { - //printf("The number -> %d is already in the Binary Search Tree\n",key); return; // se il valore si trova già nell'albero si esce ! } aux2 = aux1; //aux2 mantiene il puntatore al nodo al quale si deve appendere il nuovo nodo if ( key < aux1->getValue() ) --- 180,185 ---- { if ( key == aux1->getValue() ) return; // se il valore si trova già nell'albero si esce ! aux2 = aux1; //aux2 mantiene il puntatore al nodo al quale si deve appendere il nuovo nodo if ( key < aux1->getValue() ) *************** *** 192,198 **** // viene istanziato il nuovo nodo e gli viene assegnato key come valore e aux2 come genitore ! aux1 = new Bst; aux1->setParent( aux2 ); ! aux1->setValue( key ); // il nuovo nodo viene appeso a sinistra o a destra di aux2 in base al suo valore --- 190,196 ---- // viene istanziato il nuovo nodo e gli viene assegnato key come valore e aux2 come genitore ! aux1 = new Bst( key ); aux1->setParent( aux2 ); ! // aux1->setValue( key ); // il nuovo nodo viene appeso a sinistra o a destra di aux2 in base al suo valore Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** avl.cpp 7 Sep 2004 10:40:17 -0000 1.12 --- avl.cpp 7 Sep 2004 11:53:10 -0000 1.13 *************** *** 29,36 **** for (int i=0;i<1500;i++) { ! bst->insert(i); } } --- 29,37 ---- for (int i=0;i<1500;i++) { ! bst->insert(i); } + } *************** *** 183,187 **** printf("Insert the number of changements you want to do on the tree\n"); scanf("%d",&upperbound); - if (choice==0) { printf("Processing AVL, wait\n"); --- 184,187 ---- *************** *** 216,220 **** GtkWidget *label=NULL; //Test *a=new Test(); ! p(); gtk_init (&argc, &argv); p(); --- 216,220 ---- GtkWidget *label=NULL; //Test *a=new Test(); ! //p(); gtk_init (&argc, &argv); p(); |