avl-cvs Mailing List for avl (Page 2)
Brought to you by:
hetfield666,
jah2003
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(15) |
Jul
(16) |
Aug
(5) |
Sep
(65) |
Oct
|
Nov
|
Dec
|
---|
From: Patrizio B. <het...@us...> - 2004-09-17 12:44:30
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17326/docs Modified Files: relazione.pdf Log Message: aggiunto il controllo, aggiornato il todo Index: relazione.pdf =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.pdf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvseiE7k7 and /tmp/cvskGoOu8 differ |
From: Patrizio B. <het...@us...> - 2004-09-17 12:44:30
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17326/src Modified Files: avl.cpp Log Message: aggiunto il controllo, aggiornato il todo Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** avl.cpp 17 Sep 2004 10:41:17 -0000 1.19 --- avl.cpp 17 Sep 2004 12:44:16 -0000 1.20 *************** *** 194,197 **** --- 194,209 ---- // 2= test comparativo + if (base_tree<upperbound) { + + upperbound=base_tree-1; + gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton2),upperbound); + GtkWidget *dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE,"The changement number you entered is bigger than the tree start dimension. Reduced to %d\n",upperbound); + gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_destroy (dialog); + + } + + if (choice==0) { prova = new Test(0,upperbound,base_tree); *************** *** 290,293 **** --- 302,311 ---- printf("Insert the number of changements you want to do on the tree\n"); scanf("%d",&upperbound); + + if (base_tree<upperbound) { + upperbound=base_tree-1; + printf("The changement number you entered is bigger than the tree start dimension. Reduced to %d\n",upperbound); + } + if (choice==0) { printf("Processing AVL, wait\n"); *************** *** 304,307 **** --- 322,326 ---- prova = new Test(2,upperbound,base_tree); } + // stampa colorata if (choice==0) aux_avl->print_best_look(); |
From: Patrizio B. <het...@us...> - 2004-09-17 12:44:30
|
Update of /cvsroot/avl/avl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17326 Modified Files: TODO Log Message: aggiunto il controllo, aggiornato il todo Index: TODO =================================================================== RCS file: /cvsroot/avl/avl/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 7 Sep 2004 17:15:19 -0000 1.8 --- TODO 17 Sep 2004 12:44:15 -0000 1.9 *************** *** 1,7 **** Codice: ! - Finire di mettere i commenti in Avlt::erase() e Bst::erase() Documentazione: ! - ripulire e impaginare --- 1,11 ---- Codice: ! - fixare il seg fault nella cancellazione della root di un bst. ! ! - fixare il problema del loop infinito + swap se il num di modifiche è alto e l'albero è piccolo Documentazione: ! - aggiungere la cancellazione in dettaglio ! ! - aggiungeree un po di valori provati e una tabella (capitolo conclusione) |
From: Patrizio B. <het...@us...> - 2004-09-17 12:29:56
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14199 Modified Files: relazione.dvi relazione.tex Log Message: manca solo la cancellazione e le tabelle per le performance nela capitolo conclusioni Index: relazione.dvi =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.dvi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs3XQuvf and /tmp/cvsjvPIdz differ Index: relazione.tex =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** relazione.tex 8 Sep 2004 17:59:54 -0000 1.10 --- relazione.tex 17 Sep 2004 12:29:45 -0000 1.11 *************** *** 35,39 **** Tuttavia, è noto che l'hardware a sè stante è inutile. ! E' (e sarà) sempre necessario del software per comandare tutte le varie periferiche in questione; questa cosa fa capire quanto una macchina di per sè velocissima possa essere inutilizabile se il software che la comanda contiene errori o è lento. --- 35,39 ---- Tuttavia, è noto che l'hardware a sè stante è inutile. ! \`E (e sarà) sempre necessario del software per comandare tutte le varie periferiche in questione; questa cosa fa capire quanto una macchina di per sè velocissima possa essere inutilizabile se il software che la comanda contiene errori o è lento. *************** *** 53,57 **** esaminata l'implementazione proposta e le conclusioni che si possono trarre dopo aver sfruttato ed eseguito il codice prodotto. ! \chapter{Breve Panoramica} La premessa di questo capitolo è quella di non essere assolutamente un riferimento esaustivo sugli alberi AVL e BST. --- 53,58 ---- esaminata l'implementazione proposta e le conclusioni che si possono trarre dopo aver sfruttato ed eseguito il codice prodotto. ! \chapter{Alberi Binari di Ricerca} ! \section{Introduzione} La premessa di questo capitolo è quella di non essere assolutamente un riferimento esaustivo sugli alberi AVL e BST. *************** *** 62,66 **** In generale gli alberi superano alcune limitazioni delle altre soluzioni, ad esempio non soffrono di limiti di spazio fisso. Generalmente ogni tipo di implementazione ha una doppia faccia, nel senso che risulta ottima e veloce in una certa operazione o in una certa sequenza di dati, mentre ha performance inferiori in altri contesti. ! In questo lavoro ci si concentrerà sull'operazione di ricerca, restringendo l'area agli alberi binari, ovvero quelli i cui nodi hanno al massimo 2 figli. L'implementazione BST è basata su questi alberi binari, con in più le condizioni: \begin{itemize} --- 63,68 ---- In generale gli alberi superano alcune limitazioni delle altre soluzioni, ad esempio non soffrono di limiti di spazio fisso. Generalmente ogni tipo di implementazione ha una doppia faccia, nel senso che risulta ottima e veloce in una certa operazione o in una certa sequenza di dati, mentre ha performance inferiori in altri contesti. ! ! \section{BST} L'implementazione BST è basata su questi alberi binari, con in più le condizioni: \begin{itemize} *************** *** 86,90 **** Il bilanciamento di un albero può essere modificato a causa di inserimenti e cancellazioni: durante queste fasi va quindi aggiunta l'attività di ribilanciamento. Nell' implementazione BST il caso peggiore delle due operazioni è uguale a O(n), ancora un costo lineare. Sorge quindi la necessità di mantenere bilanciato l'albero in modo più efficiente: l'implementazione AVL è una buona soluzione. ! Gli alberi AVL sono degli alberi BST, con associata un'informazione aggiuntiva per tutti i nodi: il fattore di bilanciamento (Fdb). L'Fdb è un intero che può assumere i valori 0 e +/-1 e rappresenta la differenza tra l'altezza del sotto albero sinistro e il sottoalbero destro di ogni nodo. I valori permettono quindi uno "sbilanciamento" di un solo livello. --- 88,92 ---- Il bilanciamento di un albero può essere modificato a causa di inserimenti e cancellazioni: durante queste fasi va quindi aggiunta l'attività di ribilanciamento. Nell' implementazione BST il caso peggiore delle due operazioni è uguale a O(n), ancora un costo lineare. Sorge quindi la necessità di mantenere bilanciato l'albero in modo più efficiente: l'implementazione AVL è una buona soluzione. ! \section{AVL} Gli alberi AVL sono degli alberi BST, con associata un'informazione aggiuntiva per tutti i nodi: il fattore di bilanciamento (Fdb). L'Fdb è un intero che può assumere i valori 0 e +/-1 e rappresenta la differenza tra l'altezza del sotto albero sinistro e il sottoalbero destro di ogni nodo. I valori permettono quindi uno "sbilanciamento" di un solo livello. *************** *** 101,107 **** \end{figure} Oltre al rilassamento del concetto di bilanciamento, gli AVL incorporano anche l'informazione relativa al Fdb e la sua gestione che ovviamente avrà un costo. L'idea è quella di spendere del tempo nel mantenere il bilanciamento dell'albero in modo da avere costi logaritmici per le operazioni fondamentali che interessano. ! L'operazione base di ricerca in un albero AVL si svolge nello stesso identico modo di un BST: partendo dalla root si procede "camminando" sul figlio destro o sinistro a seconda che il valore da cercare sia rispettivamente maggiore o minore del valore del nodo in cui ci si trova. In questo modo si effettua una ricerca rapidissima dal costo logaritmico rispetto al numero di elementi che compongono l'albero. Se la ricerca è una operazione di lettura (e restituzione del nodo eventualemente) che non modifica l'albero, le operazioni di inserimento e cancellazione possono sbilanciare un AVL e far violare le proprietà esposte precedentemente. Tuttavia non è necessario ribilanciare completamente tutto l'albero (operazione costosa che avrebbe compromesso l'efficenza di tutto l'algoritmo), ma è sufficiente ribilanciare il ramo interessato dalla modifica in scrittura. Questa dovrebbe essere una cosa scontata, una modifica può cambiare un solo ramo, di certo non stravolgerà i rami che contengono tutti i nodi con valori inferiori. Gli AVL vengono mantenuti bilanciati attraverso le Rotazioni. Questa operazione non fa altro che ruotare (d'altronde il nome..) i vari nodi, in modo da poter sempre tenere l'albero bilanciato. --- 103,113 ---- \end{figure} Oltre al rilassamento del concetto di bilanciamento, gli AVL incorporano anche l'informazione relativa al Fdb e la sua gestione che ovviamente avrà un costo. L'idea è quella di spendere del tempo nel mantenere il bilanciamento dell'albero in modo da avere costi logaritmici per le operazioni fondamentali che interessano. ! \subsection{Ricerca} ! L'operazione base di ricerca in un albero AVL si svolge nello stesso identico modo di un BST: partendo dalla root si procede "camminando" sul figlio destro o sinistro a seconda che il valore da cercare sia rispettivamente maggiore o minore del valore del nodo in cui ci si trova. In questo modo si effettua una ricerca rapidissima dal costo logaritmico rispetto al numero di elementi che compongono l'albero. Il costo sarà sempre logaritmico perchè l'albero AVL viene sempre mantenuto bilanciato e non ha quindi il difetto dei BST semplici. ! ! \subsection{Inserimento} Se la ricerca è una operazione di lettura (e restituzione del nodo eventualemente) che non modifica l'albero, le operazioni di inserimento e cancellazione possono sbilanciare un AVL e far violare le proprietà esposte precedentemente. Tuttavia non è necessario ribilanciare completamente tutto l'albero (operazione costosa che avrebbe compromesso l'efficenza di tutto l'algoritmo), ma è sufficiente ribilanciare il ramo interessato dalla modifica in scrittura. Questa dovrebbe essere una cosa scontata, una modifica può cambiare un solo ramo, di certo non stravolgerà i rami che contengono tutti i nodi con valori inferiori. + Gli AVL vengono mantenuti bilanciati attraverso le Rotazioni. Questa operazione non fa altro che ruotare (d'altronde il nome..) i vari nodi, in modo da poter sempre tenere l'albero bilanciato. *************** *** 124,128 **** \end{figure} ! La figura \ref{fig:ll} visualizza il comportamento della rotazione LL. Il nodo di partenza ha Fdb pari a +1. E' evidente che se l'Fdb fosse uguale a 0 non ci sarebbe bisogno di ribilanciare l'albero in quando, ovunque un nodo venisse inserito, il nuovo Fdb sarebbe pari a +/- 1, compatibile con gli AVL. In questo caso viene inserito un nuovo nodo nel ramo sinistro del sottoalbero sinistro, modificando in +2 il valore del Fdb della radice. A questo punto viene effettuata la rotazione LL: A sale di un livello e B scende, diventando figlio di A. Tuttavia A aveva già due sotto alberi, i cui valori erano sicuramente inferiori a B per la nozione di AVL. Il sotto albero destro di A viene quindi appeso come sottoalbero sinistro di B. Ora l'albero è di nuovo bilanciato. Da notate che sia A che B ora hanno Fdb pari a zero, quindi un successivo inserimento sarà privo di problemi di bilanciamento. La rotazione RR lavora in modo simmetrico, ovviamente. --- 130,134 ---- \end{figure} ! La figura \ref{fig:ll} visualizza il comportamento della rotazione LL. Il punto a) illustra la situazione iniziale: il nodo di partenza ha Fdb pari a +1. E' evidente che se l'Fdb fosse uguale a 0 non ci sarebbe bisogno di ribilanciare l'albero in quando, ovunque un nodo venisse inserito, il nuovo Fdb sarebbe pari a +/- 1, compatibile con gli AVL. Nel punto b) viene inserito un nuovo nodo (rappresentato con un pallino vuoto) nel ramo sinistro del sottoalbero sinistro, modificando in +2 il valore del Fdb della radice. A questo punto viene effettuata la rotazione LL: A sale di un livello e B scende, diventando figlio di A. Tuttavia A aveva già due sotto alberi, i cui valori erano sicuramente inferiori a B per la nozione di AVL. Il sotto albero destro di A viene quindi appeso come sottoalbero sinistro di B. Ora l'albero è di nuovo bilanciato. Da notate che sia A che B ora hanno Fdb pari a zero, quindi un successivo inserimento sarà privo di problemi di bilanciamento. Il punto c) mostra come si presenta l'albero dopo l'inserimento e la rotazione descritta. La rotazione RR lavora in modo simmetrico, ovviamente. *************** *** 166,169 **** --- 172,176 ---- \end{itemize} + \subsection{Cancellazione} La cancellazione di un nodo AVL è identica a quella in un albero BST, tuttavia soffre degli stessi problemi dell'inserimento: a seguito dell'eliminazione di un nodo l'albero potrebbe essersi sbilanciato. E' quindi necessario ripetere gli stessi controlli di cui si è parlato in precedenza: partire dal nodo più basso del ramo interessato e risalire, bilanciando tutti i nodi con Fdb pari a +/- 2 con rotazioni singole o doppie. *************** *** 176,185 **** In totale il costo di una cancellazione è O(log(n)) nel caso peggiore. ! \chapter{Applicazione}\label{Applicazione} ! La struttura dell'applicazione è stata divisa in quattro parti fondamentali. ! Due sono le parti relative alle strutture dati e agli algoritmi AVL (avlt.cpp e avlt.h) e BST (bst.cpp e bst.h), che forniscono ovviamente le funzioni di accesso, creazione e manipolazione degli alberi stessi. ! Le altre due parti sono un "client" per generare gli alberi, fare dei test di inserimento e cancellazione (test.cpp), e un programma in GTK per la grafica a video degli alberi tramite una gradevole GUI (avl.cpp). ! Il linguaggio utilizzato è il C++, che permette di sfruttare le nozioni di ereditarietà tra i BST e gli AVL. \begin{figure}[htbp] \begin{center} --- 183,206 ---- In totale il costo di una cancellazione è O(log(n)) nel caso peggiore. ! \chapter{Implementazione}\label{Applicazione} ! \section{Struttura e caratteristiche del codice} ! Nei capitoli precedenti gli AVL sono stati descriti come dei BST a cui vengono applicate operazione di bilanciamento dette rotazioni. \`E quindi evidente che gli AVL sono a tutti gli effetti dei BST: è questa la ragione della implementazione in C++ (e non il semplice C), linguaggio orientato agli oggetti che permette di sfruttare l'ereditarietà tra gli AVL e i BST. ! L'implementazione proposta è costituita da quattro parti fondamentali. ! \begin{itemize} ! \item bst.cpp e bst.h: contengono la classe Bst, che implementa gli alberi BST con tutte le strutture dati utilizzate, i metodi di ricerca, di inserimento, di cancellazione, di restituzione dei nodi, di conteggio del massimo e minimo valore, ed infine diversi metodi di visualizzazione (stampa) degli alberi. ! \item avlt.cpp e avlt.h: implementano la classe Avlt, derivandola dalla classe Bst descritta in precedenza. Di conseguenza contengono gli stessi attributi e metodi dei Bst, con l'aggiunta della gestione del Fdb e i metodi che scelgono e implementano le rotazioni necessarie. ! \item test.cpp e test.h: classe Test. \`E la classe che si occupa dei test su entrambi i tipi di albero: si occupa della inizializzazione e primo popolamento degli alberi, ed effettua cancellazioni ed inserimenti random, restituendo il valore del lasso di tempo impiegato. \`E possibile scegliere un test comparativo tra entrambi gli alberi. ! \item avl.cpp: è il vero e proprio Main, la classe client. Si occupa di fornire un'interfaccia di input/output all'utente, permettendo la scelta dei test da effettuare, del numero di nodi con cui popolare l'albero, del numero delle modifiche di interesse. ! \end{itemize} + Il client (avl.cpp) e le funzioni di stampa contenute in bst.cpp hanno due modalità grafiche: una è basata sul semplice utilizzo delle funzioni C/C++ (printf, cout, scanf) che implementano un'applicazione a linea di comando. + L'altra, molto più interessante, implementa una GUI attraverso l'uso delle librerie GTK (www.gtk.org). + La GUI permette una visualizzazione degli alberi molto più completa, gradevole ed intuitiva, inoltre permette di effettuare più test senza riavviare l'applicazione e di manipolare gli alberi a proprio piacimento inserendo e cancellando valori scelti dall'utente (questa particolarità non è presente nel client a linea di comando). + La scelta delle due interfacce va effettuata al momento della compilazione, il codice è separato e distinto tramite comandi del preprocessore del compilatore \#ifdef , in modo da mantenere il codice più snello e pulito possibile. + Da notare che l'implementazione della classi di Test e del client è del tutto indipendente dall'implementazione degli alberi: si possono infatti includere in qualunque altro progetto C++ per sfruttare gli algoritmi in questione. + \`E stata prevista anche la compilazione delle due classi come libreria separata e condivisa: questo significa che il codice compilato non verrà incluso direttamente nell'applicazione, ma verrà caricato al volo durante il runtime. + Il vantaggio è evidente: se più applicazioni utilizzano questo stesso codice non si spregherà nè del tempo di compilazione, nè spazio fisico su harddisk, rendendo i file binari più snelli e di conseguenza anche più veloci nel caricamento in memoria RAM. + + Nella figura \ref{fig:trees} si è modellato tramite UML la struttura delle classi degli alberi, indicando l'ereditarietà, i metodi (distinguendo tra pubblici e privati), le variabili (sempre distinguendo tra pubbliche e private), quindi le interfacce delle classi. \begin{figure}[htbp] \begin{center} *************** *** 190,193 **** --- 211,216 ---- \end{figure} + Nella figura \ref{fig:applicazione} si è modellato il resto dell'implementazione: il main che crea un oggetto di tipo Test che al suo interno include due oggetti, un Avlt e un Bst, che andrà a manipolare e testare. + Si è fatto uso degli stereotipi UML, tuttavia la rappresentazione è abbastanza intuitiva anche per i non esperti di questo linguaggio. \begin{figure}[htbp] \begin{center} *************** *** 198,214 **** \end{figure} Il codice è distribuito sotto licenza GPL e include commenti esplicativi per tutte le funzioni. ! Attraverso il Makefile (chi è familiare con l'ambiente UNIX conosce le potenzialità di scripting che offre) è stata prevista la scelta della compilazione della GUI e della compilazione in modalità libreria condivisa: quest'ultima permette di sfruttare gli algoritmi implementati in qualunque applicazione C++. Opzioni Makefile: \begin {itemize} ! \item make -> compila l'applicazione implementando la visualizzazione su shell. \item make gui -> compila l'applicazione implementando la visualizzazione tramite interfaccia grafica scritta in ! GTK. E' necessaria la presenza dei pacchetti devel della libraria GTK. ! \\item make shared -> la compilazione è divisa in due: una parte riguarda il client, l'altra riguarda gli algoritmi, ! che vengono linkati come "shared". in questo modo è possibile utilizzarli in tutte le altre applicazioni necessarie e ! il file binario è di dimensioni più contenute. \end{itemize} \chapter{Conclusioni}\label{Conclusioni} Nei test effettuati, ripetendo numerose volte la costruzione di alberi AVL e BST, e poi applicandovi numerose modifiche casuali di tipo inserimento e cancellazione si è notato come la differenza tra le due implementazioni sia davvero minima e poco percettibile. Se si considera la differenza di costi (uno lineare, l'altro logaritmico) questo risultato appare impossibile. --- 221,247 ---- \end{figure} + \newpage + + \section{Compilazione ed utilizzo} Il codice è distribuito sotto licenza GPL e include commenti esplicativi per tutte le funzioni. ! Viene distribuito un file compresso tramite gzip (avl.tar.gz). ! Dopo varlo scompattato (tar xzf avl.tar.gz) si troveranno due directory: "docs" e "src". ! La priam contine questa relazione in formato tex (latex), pdf e dvi. ! Per l'applicazione si entri nella directory "src". ! ! Attraverso il Makefile (chi è familiare con l'ambiente UNIX conosce le potenzialità di scripting che offre) è stata prevista la scelta della compilazione abilitando diverse modalità. Opzioni Makefile: \begin {itemize} ! \item make -> compila l'applicazione implementando la visualizzazione su shell, il client a linea di comando. \item make gui -> compila l'applicazione implementando la visualizzazione tramite interfaccia grafica scritta in ! GTK. \`E necessaria la presenza dei pacchetti devel della libreria GTK. ! \item make shared -> la compilazione è divisa in due: una parte riguarda il client, l'altra riguarda gli algoritmi, ! che vengono linkati come "shared". In questo modo è possibile utilizzarli in tutte le altre applicazioni necessarie e ! il file binario è di dimensioni più contenute. Si crea un binario "avl" e la libreria condivisa "libavl.a". ! \end{itemize} + \chapter{Conclusioni}\label{Conclusioni} Nei test effettuati, ripetendo numerose volte la costruzione di alberi AVL e BST, e poi applicandovi numerose modifiche casuali di tipo inserimento e cancellazione si è notato come la differenza tra le due implementazioni sia davvero minima e poco percettibile. Se si considera la differenza di costi (uno lineare, l'altro logaritmico) questo risultato appare impossibile. |
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 ); |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-17 11:27:54
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2104 Modified Files: avlt.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** avlt.cpp 17 Sep 2004 07:58:46 -0000 1.13 --- avlt.cpp 17 Sep 2004 11:27:36 -0000 1.14 *************** *** 337,341 **** aux1 = aux2 = NULL; aux = this; ! if(key == getValue()) { //Questi passaggi sono simili a quelli utilizzati per i bst --- 337,341 ---- aux1 = aux2 = NULL; aux = this; ! if(key == getValue()) { //Questi passaggi sono simili a quelli utilizzati per i bst *************** *** 350,355 **** aux2 = (Avlt *)(aux1->getRight()); ! if( aux2 ) aux2->setParent( aux1->getParent() ); if( aux1->getParent() ) --- 350,358 ---- aux2 = (Avlt *)(aux1->getRight()); ! if( aux2 ){ aux2->setParent( aux1->getParent() ); + if(aux1 == this) + aux = aux2; + } if( aux1->getParent() ) *************** *** 361,365 **** aux1->setLeft( NULL ); aux1->setRight( NULL ); ! aux = aux2; if( aux1 != this ) { --- 364,368 ---- aux1->setLeft( NULL ); aux1->setRight( NULL ); ! if( aux1 != this ) { |
From: Patrizio B. <het...@us...> - 2004-09-17 10:41:27
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25600 Modified Files: avl.cpp bst.cpp Log Message: some bug fixed, some corrections. bug # = 3 Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** bst.cpp 16 Sep 2004 17:51:16 -0000 1.18 --- bst.cpp 17 Sep 2004 10:41:17 -0000 1.19 *************** *** 20,32 **** #include "bst.h" - /*Bst::Bst() - { - //Bst(0); - setValue(0); - setLeft(NULL); - setRight(NULL); - setParent(NULL); - }*/ - Bst::Bst(int val ) { --- 20,23 ---- *************** *** 436,443 **** aux=iter2; //ricorda a che punto stiamo, appende tutti i rami destri e riprende ! if( getRight() ) { msg=NULL; ! msg = g_strdup_printf ("(son of: %d) Right Value: %d", getValue(),getRight()->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,&iter2); gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, msg, -1); --- 427,434 ---- aux=iter2; //ricorda a che punto stiamo, appende tutti i rami destri e riprende ! if( this->getRight() ) { msg=NULL; ! msg = g_strdup_printf ("(son of: %d) Right Value: %d", (int)getValue(),(int)getRight()->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,&iter2); gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, msg, -1); *************** *** 445,449 **** iter2=iter1; ! getRight()->print_gtk_ric(); } iter2=aux; //riprende dopo aver appeso i rami destri, e termina con i rami sinistri --- 436,440 ---- iter2=iter1; ! this->getRight()->print_gtk_ric(); } iter2=aux; //riprende dopo aver appeso i rami destri, e termina con i rami sinistri *************** *** 451,455 **** { msg=NULL; ! msg = g_strdup_printf ("(son of: %d) Left Value: %d", getValue(),getLeft()->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,&iter2); gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, msg, -1); --- 442,446 ---- { msg=NULL; ! msg = g_strdup_printf ("(son of: %d) Left Value: %d", (int)getValue(),(int)getLeft()->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,&iter2); gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, msg, -1); *************** *** 457,461 **** iter2=iter1; ! getLeft()->print_gtk_ric(); } --- 448,452 ---- iter2=iter1; ! this->getLeft()->print_gtk_ric(); } *************** *** 463,467 **** } - GtkWidget* Bst::print_best_look() { --- 454,457 ---- Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** avl.cpp 16 Sep 2004 17:51:16 -0000 1.18 --- avl.cpp 17 Sep 2004 10:41:17 -0000 1.19 *************** *** 87,91 **** sprintf(fullname,"BST Tree Visualization after the %s of value %d",operation,value); nodelist=aux_bst->print_best_look(); ! temp_node_list=aux_avl->print_best_look(); } else return; --- 87,91 ---- sprintf(fullname,"BST Tree Visualization after the %s of value %d",operation,value); nodelist=aux_bst->print_best_look(); ! temp_node_list=aux_bst->print_best_look(); } else return; *************** *** 105,114 **** gtk_widget_show (temp_node_list); gtk_widget_show (popup_window); - } void test_single_operation() { ! GtkWidget* dialog; switch(choice) { case 2: --- 105,116 ---- gtk_widget_show (temp_node_list); gtk_widget_show (popup_window); } void test_single_operation() { ! ! int value=0; GtkWidget* dialog; + value=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3)); + switch(choice) { case 2: *************** *** 126,135 **** else { if (insert) { ! aux_bst->insert(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); ! popup_window(1,"insertion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); } else { ! aux_bst->erase(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); ! popup_window(1,"deletion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); } } --- 128,143 ---- else { if (insert) { ! aux_bst->insert(value); ! popup_window(1,"insertion",value ); } else { ! if (aux_bst->nodes() <2) { ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "You can't delete, that's onlt one node left in the BST tree!"); ! gtk_dialog_run (GTK_DIALOG(dialog)); ! gtk_widget_destroy (dialog);} ! else { ! aux_bst->erase(value); ! popup_window(1,"deletion", value); ! } } } *************** *** 145,158 **** else { if (insert) { ! aux_avl=aux_avl->insert(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); ! popup_window(0,"insertion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); } else { ! aux_avl=aux_avl->erase(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); ! popup_window(0,"deletion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); ! } ! } break; default:; } --- 153,173 ---- else { if (insert) { ! aux_avl=aux_avl->insert(value); ! popup_window(0,"insertion", value); } else { ! if (aux_avl->nodes() <2) { ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "You can't delete, that's only one node left in the AVL tree!"); ! gtk_dialog_run (GTK_DIALOG(dialog)); ! gtk_widget_destroy (dialog); ! } ! else { ! aux_avl=aux_avl->erase(value); ! popup_window(0,"deletion", value); ! } ! } } break; + default:; } |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-17 07:58:54
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26342 Modified Files: avlt.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** avlt.cpp 8 Sep 2004 10:14:46 -0000 1.12 --- avlt.cpp 17 Sep 2004 07:58:46 -0000 1.13 *************** *** 335,339 **** // Il metodo consiste nella ricerca del nodo da eliminare tramite un algoritmo ricorsivo. Una volta trovato il nodo si elimina utilizzando un algoritmo simile a quello dei BST. Durante l'eliminazione l'albero potrebbe essersi sbilanciato lungo tutto il cammino che va dalla radice alla posizione del nodo da eliminare. Nel caso in cui il nodo da eliminare ha entrambi i figli l'albero potrebbe sbilanciarsi nel cammino che va dal nodo da eliminare ed il suo successore. Avlt * aux, *aux1, *aux2; ! aux = this; --- 335,339 ---- // Il metodo consiste nella ricerca del nodo da eliminare tramite un algoritmo ricorsivo. Una volta trovato il nodo si elimina utilizzando un algoritmo simile a quello dei BST. Durante l'eliminazione l'albero potrebbe essersi sbilanciato lungo tutto il cammino che va dalla radice alla posizione del nodo da eliminare. Nel caso in cui il nodo da eliminare ha entrambi i figli l'albero potrebbe sbilanciarsi nel cammino che va dal nodo da eliminare ed il suo successore. Avlt * aux, *aux1, *aux2; ! aux1 = aux2 = NULL; aux = this; *************** *** 360,364 **** aux1->setLeft( NULL ); ! aux1->setRight( NULL ); if( aux1 != this ) { --- 360,365 ---- aux1->setLeft( NULL ); ! aux1->setRight( NULL ); ! aux = aux2; if( aux1 != this ) { *************** *** 368,391 **** do{ aux2=(Avlt *)(aux2->getParent()); ! if(aux2) ! { aux2->setFdb(); if( aux2->getFdb() == -2 ) //Se l'albero si è sbilanciato verso destra if( ((Avlt *)(aux2->getRight()))->getFdb() == +1) //Se il sottoalbero di destra ha il ramo sinistro più lungo si opera una rotazione ds altrimenti una rotazione dd ! { ! ((Avlt *)(aux2->getRight()))->rightRotate(); ! aux2->leftRotate(); ! } ! else ! aux2->leftRotate(); else //condizioni simmetriche a sopra if( aux2->getFdb() == 2 ) if( ((Avlt *)(aux2->getLeft()))->getFdb() == -1) { ! ((Avlt *)(aux2->getLeft()))->leftRotate(); ! aux2->rightRotate(); ! } ! else ! aux2->rightRotate(); } }while( aux2 != this && aux2 ); --- 369,392 ---- do{ aux2=(Avlt *)(aux2->getParent()); ! if(aux2) ! { aux2->setFdb(); if( aux2->getFdb() == -2 ) //Se l'albero si è sbilanciato verso destra if( ((Avlt *)(aux2->getRight()))->getFdb() == +1) //Se il sottoalbero di destra ha il ramo sinistro più lungo si opera una rotazione ds altrimenti una rotazione dd ! { ! ((Avlt *)(aux2->getRight()))->rightRotate(); ! aux2->leftRotate(); ! } ! else ! aux2->leftRotate(); else //condizioni simmetriche a sopra if( aux2->getFdb() == 2 ) if( ((Avlt *)(aux2->getLeft()))->getFdb() == -1) { ! ((Avlt *)(aux2->getLeft()))->leftRotate(); ! aux2->rightRotate(); ! } ! else ! aux2->rightRotate(); } }while( aux2 != this && aux2 ); |
From: Patrizio B. <het...@us...> - 2004-09-16 17:51:36
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24641 Modified Files: Makefile avl.cpp bst.cpp test.cpp Log Message: added new gui things! Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** bst.cpp 8 Sep 2004 10:14:46 -0000 1.17 --- bst.cpp 16 Sep 2004 17:51:16 -0000 1.18 *************** *** 466,477 **** GtkWidget* Bst::print_best_look() { ! GtkWidget *scrolled_window; ! GtkWidget *tree_view; ! GtkCellRenderer *cell; ! GtkTreeViewColumn *column; ! Bst* root; ! gchar* msg; //creo una contenitore che sia scrollabile --- 466,477 ---- GtkWidget* Bst::print_best_look() { ! GtkWidget *scrolled_window=NULL; ! GtkWidget *tree_view=NULL; ! GtkCellRenderer *cell=NULL; ! GtkTreeViewColumn *column=NULL; ! Bst* root=NULL; ! gchar* msg=NULL; //creo una contenitore che sia scrollabile *************** *** 496,500 **** //prendo la root e stampo tutto l'albero, appendo il primo valore e poi ricorsivamente tutti gli altri root=this->root(); ! msg = g_strdup_printf ("%d", root->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter2,&iter1); --- 496,500 ---- //prendo la root e stampo tutto l'albero, appendo il primo valore e poi ricorsivamente tutti gli altri root=this->root(); ! if (root) { msg = g_strdup_printf ("%d", root->getValue()); gtk_tree_store_append (GTK_TREE_STORE (store), &iter2,&iter1); *************** *** 503,507 **** root->print_gtk_ric(); ! //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); --- 503,507 ---- root->print_gtk_ric(); ! } //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); Index: Makefile =================================================================== RCS file: /cvsroot/avl/avl/src/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 8 Sep 2004 17:59:54 -0000 1.9 --- Makefile 16 Sep 2004 17:51:16 -0000 1.10 *************** *** 2,6 **** ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI else CC=g++ -O2 -Wall -W --- 2,6 ---- ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI -g else CC=g++ -O2 -Wall -W Index: test.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/test.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test.cpp 8 Sep 2004 17:59:54 -0000 1.14 --- test.cpp 16 Sep 2004 17:51:16 -0000 1.15 *************** *** 28,32 **** Test::~Test() { ! } --- 28,32 ---- Test::~Test() { ! if(result_log) free(result_log); } Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** avl.cpp 8 Sep 2004 17:59:54 -0000 1.17 --- avl.cpp 16 Sep 2004 17:51:16 -0000 1.18 *************** *** 38,46 **** #ifdef GUI ! GtkWidget *node_list=NULL; GtkWidget *vpaned1=NULL; GtkWidget *spinbutton1=NULL; GtkWidget *spinbutton2=NULL; // le prossime tre funzioni sono associate al radio button per la scelta del test --- 38,49 ---- #ifdef GUI ! GtkWidget* node_list_start(); ! bool insert=true; GtkWidget *node_list=NULL; GtkWidget *vpaned1=NULL; GtkWidget *spinbutton1=NULL; GtkWidget *spinbutton2=NULL; + GtkWidget *spinbutton3=NULL; + GtkWidget *nodelist=NULL; // le prossime tre funzioni sono associate al radio button per la scelta del test *************** *** 57,60 **** --- 60,171 ---- } + void shutdown_window() { + + gtk_widget_destroy(node_list); + node_list=nodelist; + + gtk_paned_add1 (GTK_PANED (vpaned1), node_list); + gtk_widget_show (node_list); + gtk_widget_show (vpaned1); + + } + + void popup_window(int kind,char* operation="",int value=9999999){ + + GtkWidget *popup_window=NULL; + GtkWidget *pane=NULL; + GtkWidget *temp_node_list; + + char fullname[200]; + + if (kind==0) { + sprintf(fullname,"AVL Tree Visualization after the %s of value %d",operation,value); + nodelist=aux_avl->print_best_look(); + temp_node_list=aux_avl->print_best_look(); + } + else if (kind==1) { + sprintf(fullname,"BST Tree Visualization after the %s of value %d",operation,value); + nodelist=aux_bst->print_best_look(); + temp_node_list=aux_avl->print_best_look(); + } + else return; + + //crea la popup window + popup_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (popup_window), fullname); + g_signal_connect_swapped (G_OBJECT (popup_window), "destroy", G_CALLBACK (shutdown_window), G_OBJECT (popup_window)); + gtk_container_set_border_width (GTK_CONTAINER (popup_window), 15); + + //crea i due pannelli verticali + pane = gtk_vpaned_new (); + gtk_container_add (GTK_CONTAINER (popup_window), pane); + gtk_widget_show (pane); + + gtk_paned_add1 (GTK_PANED (pane), temp_node_list); + gtk_widget_show (temp_node_list); + gtk_widget_show (popup_window); + + } + + void test_single_operation() { + + GtkWidget* dialog; + switch(choice) { + case 2: + dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "You must choice AVL or BST tree test"); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + break; + + case 1: + if (aux_bst==NULL) { + dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "You must initialise a BST tree before!"); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + else { + if (insert) { + aux_bst->insert(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + popup_window(1,"insertion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + } + else { + aux_bst->erase(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + popup_window(1,"deletion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + } + } + + break; + + case 0: + if (aux_avl==NULL) { + dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "You must initialise an AVL tree before!"); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + else { + if (insert) { + aux_avl=aux_avl->insert(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + popup_window(0,"insertion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + } + else { + aux_avl=aux_avl->erase(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + popup_window(0,"deletion", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton3))); + } + + } + break; + default:; + } + } + + void ins_select() { + insert=true; + } + + void del_select() { + insert=false; + } + + // linkato col bottone start. Fa partire il test scelto e poi aggiorna a video // la visualizzazione dell'albero o il report comparativo. *************** *** 94,98 **** gtk_widget_show (box1); - //view= gtk_label_new ("Tree display disabled\nComparation test choosen"); view=gtk_label_new(prova->getResultLog()); gtk_container_add (GTK_CONTAINER (box1), view); --- 205,208 ---- *************** *** 184,188 **** #else ! GtkWidget *window=NULL; GtkWidget *vpaned2=NULL; --- 294,298 ---- #else ! GtkWidget *window=NULL; GtkWidget *vpaned2=NULL; *************** *** 193,196 **** --- 303,307 ---- GtkWidget *box4=NULL; GtkWidget *box5=NULL; + GtkWidget *box6=NULL; GSList *group=NULL; GtkAdjustment *adj=NULL; *************** *** 241,244 **** --- 352,360 ---- gtk_widget_show (box5); + box6 = gtk_hbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (box6), 10); + gtk_box_pack_start (GTK_BOX (box1), box6, TRUE, TRUE, 0); + gtk_widget_show (box6); + //il contenitore per la scelta dei test label = gtk_label_new ("What do you want to test?"); *************** *** 256,260 **** button = gtk_radio_button_new_with_label (group, "BST"); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (bst_select),G_OBJECT (button)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); --- 372,375 ---- *************** *** 292,305 **** gtk_box_pack_start (GTK_BOX (box4), spinbutton2, FALSE, TRUE, 0); gtk_widget_show (spinbutton2); //start e quit button ! button = gtk_button_new_with_label ("start"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (start), G_OBJECT (window)); ! gtk_box_pack_start (GTK_BOX (box5), button, FALSE, TRUE, 55); gtk_widget_show (button); ! button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_main_quit), G_OBJECT (window)); ! gtk_box_pack_start (GTK_BOX (box5), button, FALSE, TRUE, 65); gtk_widget_show (button); --- 407,450 ---- gtk_box_pack_start (GTK_BOX (box4), spinbutton2, FALSE, TRUE, 0); gtk_widget_show (spinbutton2); + + label = gtk_label_new ("Select operation and insert a value"); + gtk_label_set_justify(GTK_LABEL (label),GTK_JUSTIFY_LEFT); + gtk_box_pack_start (GTK_BOX (box5), label, TRUE, TRUE, 0); + gtk_widget_show (label); + + button = gtk_radio_button_new_with_label (NULL, "Insert"); + g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (ins_select),G_OBJECT (button)); + gtk_box_pack_start (GTK_BOX (box5), button, TRUE, TRUE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_widget_show (button); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); + button = gtk_radio_button_new_with_label (group, "Deletion"); + g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (del_select),G_OBJECT (button)); + gtk_box_pack_start (GTK_BOX (box5), button, TRUE, TRUE, 0); + gtk_widget_show (button); + + adj = (GtkAdjustment *) gtk_adjustment_new (500, 0, 10000000, 10, 0, 0); + spinbutton3 = gtk_spin_button_new (adj, 0, 0); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinbutton3), FALSE); + gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (spinbutton3), TRUE); + gtk_spin_button_set_value(GTK_SPIN_BUTTON (spinbutton3), 1000); + gtk_box_pack_start (GTK_BOX (box5), spinbutton3, FALSE, TRUE, 0); + gtk_widget_show (spinbutton3); + + button = gtk_button_new_with_label ("Apply Modification"); + g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (test_single_operation), NULL); + gtk_box_pack_start (GTK_BOX (box5), button, FALSE, TRUE, 55); + gtk_widget_show (button); + //start e quit button ! button = gtk_button_new_with_label ("Initialise"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (start), G_OBJECT (window)); ! gtk_box_pack_start (GTK_BOX (box6), button, FALSE, TRUE, 55); gtk_widget_show (button); ! button = gtk_button_new_with_label ("Close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_main_quit), G_OBJECT (window)); ! gtk_box_pack_start (GTK_BOX (box6), button, FALSE, TRUE, 65); gtk_widget_show (button); |
From: Patrizio B. <het...@us...> - 2004-09-08 18:03:38
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14757 Modified Files: relazione.pdf Log Message: forgot this! Index: relazione.pdf =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.pdf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsscvpdc and /tmp/cvs2DZg0b differ |
From: Patrizio B. <het...@us...> - 2004-09-08 18:00:30
|
Update of /cvsroot/avl/avl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14056 Modified Files: ChangeLog Log Message: Final version up, please test comparate method Index: ChangeLog =================================================================== RCS file: /cvsroot/avl/avl/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ChangeLog 7 Sep 2004 17:15:25 -0000 1.10 --- ChangeLog 8 Sep 2004 17:59:50 -0000 1.11 *************** *** 1,2 **** --- 1,8 ---- + --==08.09.2004==-- + <hetfield666>: + - Added new report method to test class + - Cleaned Comparate method + - Added comments and cleaning to all functions + --==07.09.2004==-- <hetfield666>: |
From: Patrizio B. <het...@us...> - 2004-09-08 18:00:15
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14056/docs Modified Files: application.eps application.png application.xmi relazione.dvi relazione.tex Log Message: Final version up, please test comparate method Index: application.xmi =================================================================== RCS file: /cvsroot/avl/avl/docs/application.xmi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** application.xmi 7 Sep 2004 15:52:54 -0000 1.2 --- application.xmi 8 Sep 2004 17:59:54 -0000 1.3 *************** *** 7,11 **** <XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding> </XMI.documentation> ! <XMI.model xmi.name="umbrelloB6RdHa" href="/tmp/kde-jah/umbrelloB6RdHa.tmp" /> <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" /> </XMI.header> --- 7,11 ---- <XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding> </XMI.documentation> ! <XMI.model xmi.name="umbrelloeclm5b" href="/home/patrizio/.kde3.3/tmp-blight/umbrelloeclm5b.tmp" /> <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" /> </XMI.header> *************** *** 33,36 **** --- 33,37 ---- <UML:Operation visibility="public" xmi.id="27" type="Avlt*" name="getAvlt" /> <UML:Operation visibility="public" xmi.id="28" type="Bst*" name="getBst" /> + <UML:Operation visibility="public" xmi.id="67" type="char*" name="getResultLog" /> <UML:Operation visibility="private" xmi.id="29" type="void" name="Avl_Test" > <UML:Parameter visibility="public" xmi.id="30" value="" type="int" name="upper_limit" /> *************** *** 54,61 **** --- 55,64 ---- <UML:Attribute visibility="private" xmi.id="41" value="" type="double" name="change_timer" /> <UML:Attribute visibility="private" xmi.id="42" value="" type="int" name="tree_dimensions" /> + <UML:Attribute visibility="private" xmi.id="65" value="" type="char*" name="result_log" /> </UML:Class> <UML:DataType stereotype="3" visibility="public" xmi.id="18" name="Avlt*" /> <UML:DataType stereotype="3" visibility="public" xmi.id="20" name="Bst*" /> <UML:Class visibility="public" xmi.id="53" name="Main" /> + <UML:DataType stereotype="3" visibility="public" xmi.id="66" name="char*" /> <UML:Association visibility="public" xmi.id="15" > <UML:Association.connection> *************** *** 79,90 **** </XMI.content> <XMI.extensions xmi.extender="umbrello" > ! <docsettings viewid="1" documentation="" uniqueid="62" /> <diagrams> ! <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="835" snapy="10" showatts="1" xmi.id="1" documentation="" type="402" showops="1" showpackage="0" name="diagramma delle classi" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="583" > <widgets> ! <classwidget usesdiagramfillcolour="1" width="37" showattsigs="601" usesdiagramusefillcolour="1" x="667" linecolour="none" y="442" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="11" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="1" width="32" showattsigs="601" usesdiagramusefillcolour="1" x="404" linecolour="none" y="440" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="12" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="0" width="527" showattsigs="601" usesdiagramusefillcolour="0" x="280" linecolour="#ff0000" y="75" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="288" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="13" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="0" width="41" showattsigs="601" usesdiagramusefillcolour="1" x="76" linecolour="#000000" y="205" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#28e6ff" height="28" usefillcolor="1" showpubliconly="0" showattributes="0" isinstance="0" xmi.id="53" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> </widgets> <messages/> --- 82,93 ---- </XMI.content> <XMI.extensions xmi.extender="umbrello" > ! <docsettings viewid="1" documentation="" uniqueid="69" /> <diagrams> ! <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="835" snapy="10" showatts="1" xmi.id="1" documentation="" type="402" showops="1" showpackage="0" name="diagramma delle classi" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="578" > <widgets> ! <classwidget usesdiagramfillcolour="1" width="37" showattsigs="601" usesdiagramusefillcolour="1" x="638" linecolour="none" y="460" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="11" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="1" width="32" showattsigs="601" usesdiagramusefillcolour="1" x="406" linecolour="none" y="463" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="12" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="0" width="527" showattsigs="601" usesdiagramusefillcolour="0" x="280" linecolour="#ff0000" y="75" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="324" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="13" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="0" width="41" showattsigs="601" usesdiagramusefillcolour="1" x="79" linecolour="#000000" y="223" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#28e6ff" height="28" usefillcolor="1" showpubliconly="0" showattributes="0" isinstance="0" xmi.id="53" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> </widgets> <messages/> *************** *** 92,111 **** <assocwidget totalcounta="3" indexa="2" totalcountb="2" indexb="1" widgetbid="11" widgetaid="13" xmi.id="15" > <linepath> ! <startpoint startx="631" starty="363" /> ! <endpoint endx="685" endy="442" /> </linepath> </assocwidget> <assocwidget totalcounta="3" indexa="1" totalcountb="2" indexb="1" widgetbid="12" widgetaid="13" xmi.id="16" > <linepath> ! <startpoint startx="455" starty="363" /> ! <endpoint endx="420" endy="440" /> </linepath> </assocwidget> <assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="13" widgetaid="53" xmi.id="57" > <linepath> ! <startpoint startx="117" starty="219" /> ! <endpoint endx="280" endy="219" /> </linepath> ! <floatingtext usesdiagramfillcolour="1" width="80" usesdiagramusefillcolour="1" x="153" linecolour="none" y="214" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="62" text="<<create>>" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" /> </assocwidget> </associations> --- 95,114 ---- <assocwidget totalcounta="3" indexa="2" totalcountb="2" indexb="1" widgetbid="11" widgetaid="13" xmi.id="15" > <linepath> ! <startpoint startx="631" starty="399" /> ! <endpoint endx="656" endy="460" /> </linepath> </assocwidget> <assocwidget totalcounta="3" indexa="1" totalcountb="2" indexb="1" widgetbid="12" widgetaid="13" xmi.id="16" > <linepath> ! <startpoint startx="455" starty="399" /> ! <endpoint endx="422" endy="463" /> </linepath> </assocwidget> <assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="13" widgetaid="53" xmi.id="57" > <linepath> ! <startpoint startx="120" starty="237" /> ! <endpoint endx="280" endy="237" /> </linepath> ! <floatingtext usesdiagramfillcolour="1" width="80" usesdiagramusefillcolour="1" x="155" linecolour="none" y="232" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="68" text="<<create>>" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" /> </assocwidget> </associations> *************** *** 119,127 **** <listitem open="1" type="813" id="12" /> <listitem open="1" type="813" id="53" /> ! <listitem open="0" type="813" id="13" > <listitem open="0" type="814" id="17" /> <listitem open="0" type="814" id="19" /> <listitem open="0" type="814" id="41" /> <listitem open="0" type="814" id="40" /> <listitem open="0" type="814" id="42" /> <listitem open="0" type="815" id="29" /> --- 122,131 ---- <listitem open="1" type="813" id="12" /> <listitem open="1" type="813" id="53" /> ! <listitem open="1" type="813" id="13" > <listitem open="0" type="814" id="17" /> <listitem open="0" type="814" id="19" /> <listitem open="0" type="814" id="41" /> <listitem open="0" type="814" id="40" /> + <listitem open="0" type="814" id="65" /> <listitem open="0" type="814" id="42" /> <listitem open="0" type="815" id="29" /> *************** *** 135,138 **** --- 139,143 ---- <listitem open="0" type="815" id="44" /> <listitem open="0" type="815" id="43" /> + <listitem open="0" type="815" id="67" /> </listitem> <listitem open="0" type="830" id="-1" label="Tipi di dati" > *************** *** 142,145 **** --- 147,151 ---- <listitem open="1" type="829" id="8" /> <listitem open="1" type="829" id="4" /> + <listitem open="1" type="829" id="66" /> <listitem open="1" type="829" id="7" /> <listitem open="1" type="829" id="6" /> *************** *** 154,975 **** </listitem> </listview> ! <codegeneration> ! <codegenerator language="Java" > ! <classifiercodedocument writeOutCode="true" package="" id="11" parent_class="11" fileExt=".java" fileName="Avlt" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="11" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Avlt&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Avlt ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="15" field_type="3" initialValue="" role_id="1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="12" parent_class="12" fileExt=".java" fileName="Bst" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="12" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Bst&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Bst ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="16" field_type="3" initialValue="" role_id="1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="13" parent_class="13" fileExt=".java" fileName="Test" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" text="&#010;import Main;&#010;import Test;" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="13" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Test&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="17" tag="tblock_0" canDelete="false" indentLevel="1" role_id="-1" text="private Avlt* avlt;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="19" tag="tblock_1" canDelete="false" indentLevel="1" role_id="-1" text="private Bst* bst;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="40" tag="tblock_2" canDelete="false" indentLevel="1" role_id="-1" text="private double init_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="41" tag="tblock_3" canDelete="false" indentLevel="1" role_id="-1" text="private double change_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="42" tag="tblock_4" canDelete="false" indentLevel="1" role_id="-1" text="private int tree_dimensions;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_5" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Avlt = new Avlt ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_6" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Bst = new Bst ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Test ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! <codeoperation parent_id="21" tag="operation_21" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" /> ! </header> ! </codeoperation> ! <codeoperation parent_id="23" tag="operation_23" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param kind &#010;@param upperbound &#010;@param base_tree_size " /> ! </header> ! </codeoperation> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="17" tag="hblock_tag_0" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="return avlt;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of avlt&#010;&#010;@return the value of avlt" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="17" tag="hblock_tag_7" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="avlt = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of avlt&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="19" tag="hblock_tag_8" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="return bst;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of bst&#010;&#010;@return the value of bst" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="19" tag="hblock_tag_9" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="bst = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of bst&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="40" tag="hblock_tag_10" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="return init_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of init_timer&#010;&#010;@return the value of init_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="40" tag="hblock_tag_11" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="init_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of init_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="41" tag="hblock_tag_12" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="return change_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of change_timer&#010;&#010;@return the value of change_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="41" tag="hblock_tag_13" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="change_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of change_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="42" tag="hblock_tag_14" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="return tree_dimensions;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of tree_dimensions&#010;&#010;@return the value of tree_dimensions" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="42" tag="hblock_tag_15" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="tree_dimensions = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of tree_dimensions&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_16" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_17" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_18" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Avlt to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_19" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Avlt from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_20" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_21" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_22" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_23" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Bst to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_24" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Bst from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_25" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks> ! <codeoperation parent_id="27" tag="operation_27" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return Avlt* " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="28" tag="operation_28" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return Bst* " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="29" tag="operation_29" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param upper_limit &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="31" tag="operation_31" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param upper_limit &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="33" tag="operation_33" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param base_tree_size &#010;@param upperbound &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="36" tag="operation_36" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param base_limit &#010;@param kind &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="43" tag="operation_43" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return double " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="44" tag="operation_44" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return double " /> ! </header> ! </codeoperation> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="17" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="17" tag="tblock_0" canDelete="false" indentLevel="1" role_id="-1" text="private Avlt* avlt;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="17" tag="hblock_tag_0" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="return avlt;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of avlt&#010;&#010;@return the value of avlt" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="17" tag="hblock_tag_7" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="avlt = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of avlt&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="19" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="19" tag="tblock_1" canDelete="false" indentLevel="1" role_id="-1" text="private Bst* bst;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="19" tag="hblock_tag_8" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="return bst;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of bst&#010;&#010;@return the value of bst" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="19" tag="hblock_tag_9" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="bst = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of bst&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="40" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="40" tag="tblock_2" canDelete="false" indentLevel="1" role_id="-1" text="private double init_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="40" tag="hblock_tag_10" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="return init_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of init_timer&#010;&#010;@return the value of init_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="40" tag="hblock_tag_11" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="init_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of init_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="41" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="41" tag="tblock_3" canDelete="false" indentLevel="1" role_id="-1" text="private double change_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="41" tag="hblock_tag_12" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="return change_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of change_timer&#010;&#010;@return the value of change_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="41" tag="hblock_tag_13" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="change_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of change_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="42" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="42" tag="tblock_4" canDelete="false" indentLevel="1" role_id="-1" text="private int tree_dimensions;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="42" tag="hblock_tag_14" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="return tree_dimensions;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of tree_dimensions&#010;&#010;@return the value of tree_dimensions" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="42" tag="hblock_tag_15" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="tree_dimensions = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of tree_dimensions&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="15" field_type="3" initialValue="" role_id="0" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_5" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Avlt = new Avlt ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_16" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_17" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_18" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Avlt to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_19" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Avlt from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_20" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="16" field_type="3" initialValue="" role_id="0" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_6" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Bst = new Bst ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_21" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_22" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_23" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Bst to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_24" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Bst from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_25" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="53" parent_class="53" fileExt=".java" fileName="Main" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" text="&#010;import Test;" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="53" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Main&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Main ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields/> ! </classifiercodedocument> ! <codedocument writeOutCode="false" package="" id="ANTDOC" fileExt=".xml" fileName="build" > ! <textblocks> ! <codeblockwithcomments tag="xmlDecl" text="<?xml version="1.0"?>" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <xmlelementblock nodeName="project" tag="projectDecl" canDelete="false" > ! <header> ! <codecomment tag="" text="Java ANT build document" /> ! </header> ! <textblocks/> ! </xmlelementblock> ! </textblocks> ! <header> ! <codecomment tag="" /> ! </header> ! </codedocument> ! </codegenerator> ! </codegeneration> </XMI.extensions> </XMI> --- 160,164 ---- </listitem> </listview> ! <codegeneration/> </XMI.extensions> </XMI> Index: application.png =================================================================== RCS file: /cvsroot/avl/avl/docs/application.png,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsYY77hG and /tmp/cvsCe3ss3 differ Index: relazione.dvi =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.dvi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsgrOWOS and /tmp/cvsbeT5Rg differ Index: application.eps =================================================================== RCS file: /cvsroot/avl/avl/docs/application.eps,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** application.eps 7 Sep 2004 15:52:54 -0000 1.2 --- application.eps 8 Sep 2004 17:59:51 -0000 1.3 *************** *** 1,34538 **** ! %!PS-Adobe-2.0 EPSF-2.0 ! %%Creator: pnmtops ! %%Title: application.ps %%Pages: 1 - %%BoundingBox: 93 22 519 770 %%EndComments ! /readstring { ! currentfile exch readhexst... [truncated message content] |
From: Patrizio B. <het...@us...> - 2004-09-08 18:00:07
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14056/src Modified Files: Makefile avl.cpp test.cpp test.h Log Message: Final version up, please test comparate method Index: test.h =================================================================== RCS file: /cvsroot/avl/avl/src/test.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test.h 7 Sep 2004 14:37:01 -0000 1.10 --- test.h 8 Sep 2004 17:59:54 -0000 1.11 *************** *** 39,42 **** --- 39,43 ---- Avlt* getAvlt(); Bst* getBst(); + char* getResultLog(); private: *************** *** 52,56 **** double change_timer; int tree_dimensions; ! }; #endif --- 53,57 ---- double change_timer; int tree_dimensions; ! char* result_log; }; #endif Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** avl.cpp 7 Sep 2004 15:33:42 -0000 1.16 --- avl.cpp 8 Sep 2004 17:59:54 -0000 1.17 *************** *** 22,25 **** --- 22,31 ---- #include <cstdlib> + /* + A seconda che sia stata scelta la GUI GTK o no + vengono compilate funzioni differenti + per la raccolta dei dati e il report + */ + using namespace std; *************** *** 38,41 **** --- 44,48 ---- GtkWidget *spinbutton2=NULL; + // le prossime tre funzioni sono associate al radio button per la scelta del test void bst_select() { choice=1; *************** *** 49,52 **** --- 56,62 ---- choice=2; } + + // linkato col bottone start. Fa partire il test scelto e poi aggiorna a video + // la visualizzazione dell'albero o il report comparativo. void start() { *************** *** 84,88 **** gtk_widget_show (box1); ! view= gtk_label_new ("Tree display disabled\nComparation test choosen"); gtk_container_add (GTK_CONTAINER (box1), view); gtk_widget_show (view); --- 94,99 ---- gtk_widget_show (box1); ! //view= gtk_label_new ("Tree display disabled\nComparation test choosen"); ! view=gtk_label_new(prova->getResultLog()); gtk_container_add (GTK_CONTAINER (box1), view); gtk_widget_show (view); *************** *** 98,102 **** } ! GtkWidget* node_list_start() { --- 109,113 ---- } ! //inizializza una lista vuota, dopo il test verrà aggiornata con l'albero o il report GtkWidget* node_list_start() { *************** *** 168,172 **** prova = new Test(2,upperbound,base_tree); } ! if (choice==0) aux_avl->print_best_look(); if (choice==1) aux_bst->print_best_look(); --- 179,183 ---- prova = new Test(2,upperbound,base_tree); } ! // stampa colorata if (choice==0) aux_avl->print_best_look(); if (choice==1) aux_bst->print_best_look(); *************** *** 186,202 **** GtkWidget *label=NULL; gtk_init (&argc, &argv); char* fullname="AVL-BST Tree Visualization"; ! window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), fullname); gtk_widget_set_usize(window, (int)(gdk_screen_width()*3/4), (int)(gdk_screen_height()*3/4)); - g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 15); vpaned1 = gtk_vpaned_new (); gtk_container_add (GTK_CONTAINER (window), vpaned1); --- 197,212 ---- GtkWidget *label=NULL; + //inizializza GTK gtk_init (&argc, &argv); char* fullname="AVL-BST Tree Visualization"; ! //crea la main window window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), fullname); gtk_widget_set_usize(window, (int)(gdk_screen_width()*3/4), (int)(gdk_screen_height()*3/4)); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 15); + //crea i due pannelli verticali vpaned1 = gtk_vpaned_new (); gtk_container_add (GTK_CONTAINER (window), vpaned1); *************** *** 206,209 **** --- 216,220 ---- gtk_widget_show (vpaned2); + //crea cinque contenitori orizzontali box1 = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (vpaned2), box1); *************** *** 230,233 **** --- 241,245 ---- gtk_widget_show (box5); + //il contenitore per la scelta dei test label = gtk_label_new ("What do you want to test?"); gtk_label_set_justify(GTK_LABEL (label),GTK_JUSTIFY_LEFT); *************** *** 253,256 **** --- 265,269 ---- gtk_widget_show (button); + //scelta del numero dei nodi label = gtk_label_new ("Select the number of nodes of the tree"); gtk_label_set_justify(GTK_LABEL (label),GTK_JUSTIFY_LEFT); *************** *** 266,269 **** --- 279,283 ---- gtk_widget_show (spinbutton1); + //scelta del numero delle modifiche label = gtk_label_new ("Select the number of operations on the tree"); gtk_label_set_justify(GTK_LABEL (label),GTK_JUSTIFY_LEFT); *************** *** 279,282 **** --- 293,297 ---- gtk_widget_show (spinbutton2); + //start e quit button button = gtk_button_new_with_label ("start"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (start), G_OBJECT (window)); *************** *** 289,292 **** --- 304,308 ---- gtk_widget_show (button); + //finalizzazione e display node_list=node_list_start(); *************** *** 302,305 **** #endif ! return EXIT_SUCCESS; } --- 318,321 ---- #endif ! return EXIT_SUCCESS; //vuol dire che ha funzionato senza seg. fault! } Index: Makefile =================================================================== RCS file: /cvsroot/avl/avl/src/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile 7 Sep 2004 15:33:42 -0000 1.8 --- Makefile 8 Sep 2004 17:59:54 -0000 1.9 *************** *** 2,6 **** ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI else CC=g++ -O2 -Wall -W --- 2,6 ---- ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI else CC=g++ -O2 -Wall -W *************** *** 30,34 **** $(BINARY): $(LIBS) $(CC) -o $(BINARY) $(LIBS) $(GTKLIBS) ! strip $(BINARY) clean: --- 30,34 ---- $(BINARY): $(LIBS) $(CC) -o $(BINARY) $(LIBS) $(GTKLIBS) ! # strip $(BINARY) clean: Index: test.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/test.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test.cpp 7 Sep 2004 15:33:42 -0000 1.13 --- test.cpp 8 Sep 2004 17:59:54 -0000 1.14 *************** *** 17,24 **** * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #include "test.h" Test::~Test() { --- 17,30 ---- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "test.h" + //concatena i risultati del test comparato in una stringa + char* Test::getResultLog(){ + + return result_log; + + } + Test::~Test() { *************** *** 30,33 **** --- 36,40 ---- } + //ritorna l'albero avl Avlt* Test::getAvlt() { *************** *** 35,43 **** } Bst* Test::getBst() { return bst; } ! //inizializza l'albero voluto void Test::Test_Init(int base_limit,int kind=0) { --- 42,53 ---- } + //ritorna l'albero bst Bst* Test::getBst() { return bst; } ! ! //inizializza l'albero voluto (avl o bst) inserendo il numero scelto di nodi ! //funziona anche come contatore e time report void Test::Test_Init(int base_limit,int kind=0) { *************** *** 85,88 **** --- 95,100 ---- //testa un AVL + // fa un numero scelto di modifiche, scegliendo in modo casuale cancellazioni e inserimenti + // di numeri random void Test::Avl_Test(int upper_limit){ *************** *** 133,136 **** --- 145,150 ---- } //testa un BST + // fa un numero scelto di modifiche, scegliendo in modo casuale cancellazioni e inserimenti + // di numeri random void Test::Bst_Test(int upper_limit) { *************** *** 178,181 **** --- 192,196 ---- //questo metodo fa un confronto delle prestazioni di un AVL e un BST + // e riporta i risultati ottenuti void Test::comparation(int base_tree_size, int upperbound ) { *************** *** 186,206 **** GtkWidget *dialog=NULL; #endif ! bst=new Bst(); avlt=new Avlt(); Test_Init(base_tree_size,1); //bst temp_timer=getInitTimer(); ! sleep(5); Test_Init(base_tree_size,0); //avl #ifndef GUI ! printf("\nInit Result:\nBST -> %lf, AVL -> %lf\n",temp_timer,getInitTimer()); ! if ((temp_timer-getInitTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); ! if ((temp_timer-getInitTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); ! if ((temp_timer-getInitTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); #else ! if ((temp_timer-getInitTimer())>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nAVL faster\n***************************\n",temp_timer,getInitTimer()); ! if ((temp_timer-getInitTimer())<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nBST faster\n***************************\n",temp_timer,getInitTimer()); ! if ((temp_timer-getInitTimer())==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nNo real differences found\n***************************\n",temp_timer,getInitTimer()); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); --- 201,224 ---- GtkWidget *dialog=NULL; #endif ! char* msg; ! char buffer[400]; bst=new Bst(); avlt=new Avlt(); + msg=(char*)malloc(400); + Test_Init(base_tree_size,1); //bst temp_timer=getInitTimer(); ! sleep(2); Test_Init(base_tree_size,0); //avl + + sprintf(buffer,"\nInit Result:\nBST -> %lf, AVL -> %lf\n",temp_timer,getInitTimer()); + if ((temp_timer-getInitTimer())>double(0)) strcat(buffer,"***************************\nAVL faster\n***************************\n"); + if ((temp_timer-getInitTimer())<double(0)) strcat(buffer,"***************************\nBST faster\n***************************\n"); + if ((temp_timer-getInitTimer())==double(0)) strcat(buffer,"***************************\nNo real differences found\n***************************\n"); #ifndef GUI ! printf("%s\n",buffer); #else ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,GTK_BUTTONS_CLOSE,buffer); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); *************** *** 208,222 **** Bst_Test(upperbound); temp_timer=getChangeTimer(); ! sleep(5); Avl_Test(upperbound); #ifndef GUI ! printf("Random modification test\n"); ! if ((temp_timer-getChangeTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); #else ! if ((temp_timer-getChangeTimer())>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nAVL faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nBST faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nNo real differences found\n***************************\n"); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); --- 226,240 ---- Bst_Test(upperbound); temp_timer=getChangeTimer(); ! sleep(2); Avl_Test(upperbound); + sprintf(msg,"%s",buffer); + sprintf(buffer,"Random modification test\n"); + if ((temp_timer-getChangeTimer())>double(0)) strcat(buffer,"***************************\nAVL faster\n***************************\n"); + if ((temp_timer-getChangeTimer())<double(0)) strcat(buffer,"***************************\nBST faster\n***************************\n"); + if ((temp_timer-getChangeTimer())==double(0)) strcat(buffer,"***************************\nNo real differences found\n***************************\n"); #ifndef GUI ! printf("%s\n",buffer); #else ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,GTK_BUTTONS_CLOSE,buffer); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); *************** *** 234,251 **** end=clock(); temp_timer=((double) (end - start)) / CLOCKS_PER_SEC; #ifndef GUI ! printf("BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n",bst->max()->getValue(),search_timer,max,temp_timer); ! if ((temp_timer-search_timer)<double(0)) printf("***************************\nAVL faster\n***************************\n"); ! if ((temp_timer-search_timer)>double(0)) printf("***************************\nBST faster\n***************************\n"); ! if ((temp_timer-search_timer)==double(0)) printf("***************************\nNo real differences found\n***************************\n"); #else ! if ((temp_timer-search_timer)<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nAVL faster\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); ! if ((temp_timer-search_timer)>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nBST faster\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); ! if ((temp_timer-search_timer)==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nNo real differences found\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); #endif } Test::Test(int kind, int upperbound, int base_tree_size) { --- 252,274 ---- end=clock(); temp_timer=((double) (end - start)) / CLOCKS_PER_SEC; + sprintf(msg,"%s %s",msg,buffer); + sprintf(buffer,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n",bst->max()->getValue(),search_timer,max,temp_timer); + if ((temp_timer-search_timer)<double(0)) strcat(buffer,"***************************\nAVL faster\n***************************\n"); + if ((temp_timer-search_timer)>double(0)) strcat(buffer,"***************************\nBST faster\n***************************\n"); + if ((temp_timer-search_timer)==double(0)) strcat(buffer,"***************************\nNo real differences found\n***************************\n"); #ifndef GUI ! printf("%s\n",buffer); #else ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,GTK_BUTTONS_CLOSE,buffer); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); #endif + result_log=(char*)malloc(sizeof(msg)+sizeof(buffer)); + sprintf(result_log,"%s %s",msg,buffer); + if(msg) free(msg); + } + //costruttore Test::Test(int kind, int upperbound, int base_tree_size) { *************** *** 259,262 **** --- 282,286 ---- bst = avlt = NULL; + result_log=""; tree_dimensions=base_tree_size; switch (kind){ *************** *** 280,283 **** --- 304,308 ---- } + //tempo di inizializzazione double Test::getInitTimer() { *************** *** 285,288 **** --- 310,314 ---- } + //tempo per le modifiche double Test::getChangeTimer() { |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-08 10:14:56
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21807 Modified Files: avlt.cpp avlt.h bst.cpp bst.h Log Message: Index: bst.h =================================================================== RCS file: /cvsroot/avl/avl/src/bst.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** bst.h 6 Sep 2004 14:12:06 -0000 1.6 --- bst.h 8 Sep 2004 10:14:46 -0000 1.7 *************** *** 45,50 **** public: ! Bst(); ! Bst(int); ~Bst(); --- 45,50 ---- public: ! // Bst(); ! Bst(int = 0); ~Bst(); Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** bst.cpp 8 Sep 2004 10:10:41 -0000 1.16 --- bst.cpp 8 Sep 2004 10:14:46 -0000 1.17 *************** *** 20,24 **** #include "bst.h" ! Bst::Bst() { //Bst(0); --- 20,24 ---- #include "bst.h" ! /*Bst::Bst() { //Bst(0); *************** *** 27,33 **** setRight(NULL); setParent(NULL); ! } ! Bst::Bst(int val) { setValue(val); --- 27,33 ---- setRight(NULL); setParent(NULL); ! }*/ ! Bst::Bst(int val ) { setValue(val); Index: avlt.h =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** avlt.h 6 Sep 2004 14:12:06 -0000 1.9 --- avlt.h 8 Sep 2004 10:14:46 -0000 1.10 *************** *** 37,42 **** public: ! Avlt(); ! Avlt( int, int ); ~Avlt(); --- 37,42 ---- public: ! // Avlt(); ! Avlt( int = 0, int = 0 ); ~Avlt(); Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** avlt.cpp 8 Sep 2004 10:10:41 -0000 1.11 --- avlt.cpp 8 Sep 2004 10:14:46 -0000 1.12 *************** *** 19,23 **** #include "avlt.h" ! Avlt::Avlt() : Bst() --- 19,23 ---- #include "avlt.h" ! /* Avlt::Avlt() : Bst() *************** *** 25,30 **** Avlt( 0,0 ); } ! ! Avlt::Avlt(int s,int val) : Bst(val) { --- 25,30 ---- Avlt( 0,0 ); } ! */ ! Avlt::Avlt(int s ,int val) : Bst(val) { |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-08 10:10:51
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21130 Modified Files: avlt.cpp bst.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** avlt.cpp 7 Sep 2004 17:15:20 -0000 1.10 --- avlt.cpp 8 Sep 2004 10:10:41 -0000 1.11 *************** *** 332,335 **** --- 332,337 ---- Avlt *Avlt::erase(int key) { + + // Il metodo consiste nella ricerca del nodo da eliminare tramite un algoritmo ricorsivo. Una volta trovato il nodo si elimina utilizzando un algoritmo simile a quello dei BST. Durante l'eliminazione l'albero potrebbe essersi sbilanciato lungo tutto il cammino che va dalla radice alla posizione del nodo da eliminare. Nel caso in cui il nodo da eliminare ha entrambi i figli l'albero potrebbe sbilanciarsi nel cammino che va dal nodo da eliminare ed il suo successore. Avlt * aux, *aux1, *aux2; *************** *** 337,341 **** if(key == getValue()) ! { if ( !getLeft() || !getRight() ) aux1 = this; --- 339,343 ---- if(key == getValue()) ! { //Questi passaggi sono simili a quelli utilizzati per i bst if ( !getLeft() || !getRight() ) aux1 = this; *************** *** 362,365 **** --- 364,368 ---- { setValue( aux1->getValue() ); + //Se si sta eliminando il successore cambiano i FdB nel cammino che va da aux1 (il nodo che verrà eliminato) al nodo corrente e l'albero potrebbe sbilanciarsi lungo tale cammino aux2 = aux1; do{ *************** *** 368,373 **** { aux2->setFdb(); ! if( aux2->getFdb() == -2 ) ! if( ((Avlt *)(aux2->getRight()))->getFdb() == +1) { ((Avlt *)(aux2->getRight()))->rightRotate(); --- 371,376 ---- { aux2->setFdb(); ! if( aux2->getFdb() == -2 ) //Se l'albero si è sbilanciato verso destra ! if( ((Avlt *)(aux2->getRight()))->getFdb() == +1) //Se il sottoalbero di destra ha il ramo sinistro più lungo si opera una rotazione ds altrimenti una rotazione dd { ((Avlt *)(aux2->getRight()))->rightRotate(); *************** *** 376,380 **** else aux2->leftRotate(); ! else if( aux2->getFdb() == 2 ) if( ((Avlt *)(aux2->getLeft()))->getFdb() == -1) --- 379,383 ---- else aux2->leftRotate(); ! else //condizioni simmetriche a sopra if( aux2->getFdb() == 2 ) if( ((Avlt *)(aux2->getLeft()))->getFdb() == -1) *************** *** 394,405 **** } ! if(key < getValue()) { if( getLeft() ) { ! ((Avlt *)getLeft())->erase( key ); ! setFdb(); if( getFdb() == -2 ) ! if( ((Avlt *)getRight())->getFdb() == +1) { ((Avlt *)getRight())->rightRotate(); --- 397,408 ---- } ! 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 ! setFdb(); //L'eliminazione in questo sottoalbero potrebbe aver cambiato l'fdb del nodo corrente e di conseguenza potrebbe essersi sbilanciato verso destra if( getFdb() == -2 ) ! if( ((Avlt *)getRight())->getFdb() == +1)//Se il sottoalbero di destra ha il ramo sinistro più lungo si opera una rotazione ds altrimenti una rotazione dd { ((Avlt *)getRight())->rightRotate(); *************** *** 411,415 **** } else ! { if( getRight() ) { --- 414,418 ---- } else ! { //operazioni simmetriche a sopra if( getRight() ) { Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** bst.cpp 7 Sep 2004 17:15:20 -0000 1.15 --- bst.cpp 8 Sep 2004 10:10:41 -0000 1.16 *************** *** 213,235 **** { Bst *aux1, *aux2; ! if ( !getLeft() || !getRight() ) aux1 = this; else aux1 = successor(); if( aux1->getLeft() ) - { aux2 = aux1->getLeft(); - //setLeft( NULL ); - } else - { aux2 = aux1->getRight(); - //setRight( NULL ); - } if( aux2 ) aux2->setParent( aux1->getParent() ); ! if( aux1->getParent() ) if( aux1 == aux1->getParent()->getLeft() ) --- 213,235 ---- { Bst *aux1, *aux2; ! ! //aux1 contiene il nodo che verrà eliminato ! if ( !getLeft() || !getRight() ) //se il nodo corrente ha al più un figlio allora è il nodo da eliminare altrimenti (cioè se ha entrambi i figli - la condizione (!getLeft() || !getRight()) è identica a !(getLeft() && getRight()) ) è il suo successore aux1 = this; else aux1 = successor(); + //aux2 viene fatto puntare al figlio sinistro, se esiste, di aux1 altrimenti al figlio destro oppure a NULL nel caso in cui aux1 non ha figli if( aux1->getLeft() ) aux2 = aux1->getLeft(); else aux2 = aux1->getRight(); + //Viene scambiato aux1 con aux2 + //Prima si assegna il padre di aux1 al padre di aux2 if( aux2 ) aux2->setParent( aux1->getParent() ); ! ! //Poi si assegna aux2 come figlio del padre di aux1 if( aux1->getParent() ) if( aux1 == aux1->getParent()->getLeft() ) *************** *** 237,243 **** else aux1->getParent()->setRight( aux2 ); ! if( aux1 != this ) setValue( aux1->getValue() ); delete aux1; //ATT!!!!!!! } --- 237,245 ---- else aux1->getParent()->setRight( aux2 ); ! ! //Se il nodo che verrà eliminato è il successore del nodo corrente allora il suo valore viene assegnato al nodo corrente if( aux1 != this ) setValue( aux1->getValue() ); + delete aux1; //ATT!!!!!!! } |
From: Patrizio B. <het...@us...> - 2004-09-07 17:15:42
|
Update of /cvsroot/avl/avl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4343 Modified Files: ChangeLog Log Message: finisheddddd Index: ChangeLog =================================================================== RCS file: /cvsroot/avl/avl/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ChangeLog 7 Sep 2004 15:33:42 -0000 1.9 --- ChangeLog 7 Sep 2004 17:15:25 -0000 1.10 *************** *** 5,8 **** --- 5,9 ---- - Added strip option to Makefile - Some cleaning and cosmetics + - Finished relation with some impagination fixes too --==07.09.2004==-- |
From: Patrizio B. <het...@us...> - 2004-09-07 17:15:35
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4343/docs Modified Files: relazione.tex trees.eps trees.png trees.xmi Added Files: relazione.dvi relazione.pdf Log Message: finisheddddd Index: trees.eps =================================================================== RCS file: /cvsroot/avl/avl/docs/trees.eps,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** trees.eps 6 Sep 2004 16:01:52 -0000 1.1 --- trees.eps 7 Sep 2004 17:15:26 -0000 1.2 *************** *** 2,8 **** %%Creator: ImageMagick 6.0.5 %%Title: trees.eps ! %%CreationDate: Mon Sep 6 17:38:23 2004 ! %%BoundingBox: 0 0 749 634 ! %%HiResBoundingBox: 0 0 749 634 %%LanguageLevel: 3 %%Pages: 1 --- 2,8 ---- %%Creator: ImageMagick 6.0.5 %%Title: trees.eps ! %%CreationDate: Tue Sep 7 19:09:12 2004 ! %%BoundingBox: 0 0 225 235 ! %%HiResBoundingBox: 0 0 225.197 235.039 %%LanguageLevel: 3 %%Pages: 1 *************** *** 195,209 **** %%EndProlog %%Page: 1 1 ! %%PageBoundingBox: 0 0 749 634 /ClipImage {} def userdict begin ! %%BeginData: 37482 BINARY Bytes DisplayImage 0 0 ! 749 634 12.000000 false false ! 749 634 0 false --- 195,209 ---- %%EndProlog %%Page: 1 1 ! %%PageBoundingBox: 0 0 225 235 /ClipImage {} def userdict begin ! %%BeginData: 23327 BINARY Bytes DisplayImage 0 0 ! 225.197 235.039 12.000000 false false ! 572 597 0 false *************** *** 211,323 **** 0 5 ! xÚì/ÍÆ#N¬¨XQQQq hàD/¡â%Pñ*8Ñ@ÅNðá%Tî©(¤¦*^HE!/ÜÂUT8qâ1ûûN&77Ù³lÝÙçá¡äövg'éíÎ'³3ÏärAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA´l (É¢5ë䨮`APâÅnÔ#ÖÄÀ L ëd`AP¦u20 (SÆÄa÷ÐPÓ4*K?û[¯[¶ Ê1ñaLûuîæaµPÈÓë^!à¨ã¿5{ºýúëc`AP¦cä-§g]÷FÏ£&í×_c 2%`Ìz0¦÷®E[JûC»ôÂ0Ø>ù;&ý6V/'PÝ·¿M Ê1ñaLçU»þ¬ÛasuÉÆÆî²LuÖõþ6m}=æGÑÆ¡Æ@AÑcøÞ69®°ßî°-ÏÏ£ðP A-)`L|Ã_O&ÃÁ§N>oòþÚÒxQå;X÷ ! òó#`0 ZIÀ¸1»÷¾Íûdø£¯ÇÇ%¾[å·0AÅ `Ìz0¦ÿaLngaãèÛ|úÒx<0f¸õúëc`AP¦cG5îÚÓ²qË/Å=«ýW½÷¾Õ<¬ÑÆB!ÏâÙ2µÓ³îÖß&Æ@eJÀø0ÆâK03þo@¿<.·ÙPb9Úwð©Ã¶ï`Â50 ZJÀX'c 2%`¬1A0ÖÉÀ LnÔ0¬c»21Azc` Ê1°NÆ@eJkÃÓ³ÞäÝ``A´6 c¨ è줱p8ÅÆ@eJéÄá?Ç<YÎÏtê«Ëþö[UAOéÄÆ@APh©<.ÕÅõJãy^t^5 ! wóéQ?¨ºAB& ! ùõù^ùQѼmYQÓ4"Þ{ߦÃéìäîIÓaÄe¤:o¿a 1AÐcúÛ*|Ô.ýKÌpzÖ£×Ï«+ö|gôõnûôoLù¼Ùþ_^ÇC!þÚa*Üóá\8C(uuÙo¼¨¦Ì?°æÆ@eJá*MG |Cú·¸gÉ¿LFÄÄâ¹ ^¥ö«¿K¬ð\81Ì´>´s×oQc 2¥Eé´®[»h<¯öô?¾Ò$¤©>)ÓoÃcE¯é(áæQm9 c``AP¶eïè[u¡|ê§KüAÒÅϾI£M/®.ûbãð £c ¨3 ! wó¦iÔUæä0{64ü¦?ÿÝ?â.qËh½¬õÊ7t1Y÷ ! ¥ýâÅ#¢Ó»îÓùM¬Vbê³ýVÆ@AëSDiÿ¯N÷öäjs;³q¶¯Í£½&ö£ýW6Z»y:J¦âÚÓ ! A?¼ñ¢ê>]JC4eç°aXgc 2%¬©ëd`AP¦u20 (SÆÀ:A)c` Ê1°NÆ@eJÀX'c 2%`¬1A0ÖÉÀ LI#ÉI2M£ò[éü{/üá¥_ªN±1AR1¦ÿ±suaÑ%jtØÓùÒÖnÞºWS~÷m«ÿ¡]û£|zÖkFX¡N1AR1&êòs¹þ¯¦üóï½Î«OëÏúà3L³1ARáPÚ·r;¹ò£¢X´ p7onõª¼?ûU!ßyÝ`´ð£GG·Mrãy¯ Éwë½oÓ:Ü=a(RܳX+²«<. ÄÆPM¬ÝyoLó°F'¥ ! ¦Ñ{×r_{Zé¾má¹Rê Ê"bL>oþÛ¥ÔôóíÏÞú¾Ó>ô¯Ø=L&C:¯Õ8 {ĺ¼X«Ë~ãEH#Wèt~Ë^s¡Ó·Ð©E¢ìÙRÚâXQ>mdsSÉ:§gÓÀ30 (SÚófÞÝÑ<ª ÞàLØ¢Õ2{ÐkÞµb³(lùi" ! rõ÷ré%vãa/®R½ÄC%B'ú7·ÃÊ$v²g½@ô«æa¼¤òáA)-bL÷¤epÝ2ÜmÜîw^7®j÷¬êrãyÕ1â5íC?Ò>ÂBîÝVÄñPéêjP{Z!¤á}/OåEÚÁÚ-¾u1ÚA)Eìí~ó°F`_?²¹øÙwï#¿þ³°_±qa={TÄúy^7ÄñxPû£ÏÀm Ê"bLï}Û=¦1oí¿!ð§El |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-07 17:15:30
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4511/src Modified Files: avlt.cpp bst.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** avlt.cpp 7 Sep 2004 13:03:21 -0000 1.9 --- avlt.cpp 7 Sep 2004 17:15:20 -0000 1.10 *************** *** 36,40 **** { //Il fattore di bilanciamento è la differenza tra l'altezza del sottoallbero di destra e quella del sottoalbero di sinistra ! if(isLeaf()) setHeight(0); else --- 36,40 ---- { //Il fattore di bilanciamento è la differenza tra l'altezza del sottoallbero di destra e quella del sottoalbero di sinistra ! if(isLeaf()) //nel caso in cui il nodo non ha foglie l'altezza del nodo è pari a 0 setHeight(0); else *************** *** 43,50 **** l = r = 0; if( getLeft() ) ! l = ((Avlt *)getLeft())->getHeight(); // l contiene l'altezza del sottoalbero sinistro if( getRight() ) ! r = ((Avlt *)getRight())->getHeight(); // r contiene l'altezza del sottoalbero destro ! setHeight( 1 + ( l>r ? l : r ) ); // viene restituita l'altezza del sottoalbero più lungo incrementata di 1 } } --- 43,50 ---- l = r = 0; if( getLeft() ) ! l = ((Avlt *)getLeft())->getHeight(); // l contiene l'altezza del ramo sinistro if( getRight() ) ! r = ((Avlt *)getRight())->getHeight(); // r contiene l'altezza del ramo destro ! setHeight( 1 + ( l>r ? l : r ) ); // l'altezza del sottoalbero più lungo incrementata di 1 viene posta come altezza del nodo } } *************** *** 53,60 **** void Avlt::setFdb( Avlt * start , Avlt * end) { ! ! while( end != start ) { ! end->setFdb(); //forse si può migliorare end = (Avlt *)end->getParent(); } --- 53,60 ---- void Avlt::setFdb( Avlt * start , Avlt * end) { ! //l'albero viene percorso dal basso verso l'alto ! while( end != start ) { ! end->setFdb(); end = (Avlt *)end->getParent(); } *************** *** 64,76 **** } int Avlt::getFdb() { int l, r; l = r = 0; if( getLeft() ) ! l = ((Avlt *)getLeft())->getHeight() + 1; //Altezza del sottoalbero di sinistra if( getRight() ) ! r = ((Avlt *)getRight())->getHeight() + 1; //Altezza del sottoalbero di destra ! return l-r; } --- 64,78 ---- } + /* Calcola il FdB del nodo corrente*/ int Avlt::getFdb() { + //Il fattore di bilanciamento è la differenza tra l'altezza del sottoallbero di destra e quella del sottoalbero di sinistra int l, r; l = r = 0; if( getLeft() ) ! l = ((Avlt *)getLeft())->getHeight() + 1; //Altezza del ramo di sinistra incrementata di 1 if( getRight() ) ! r = ((Avlt *)getRight())->getHeight() + 1; //Altezza del ramo di destra incrementata di 1 ! return l-r; //Restituisce la differenza tra l'altezza del ramo di sinistra e quella del ramo di destra (secondo la definizione di FdB) } *************** *** 85,105 **** } ! /* Effettua una rotazione verso sinistra e restituisce il nuovo nodo genitore*/ ! Avlt *Avlt::leftRotate() //dd { Avlt *aux; ! aux = (Avlt *)getRight(); if( aux ) { setRight( getRight()->getLeft() ); - if( getRight() ) getRight()->setParent( this ); ! aux->setLeft( this ); aux->setParent( getParent() ); ! if( getParent() ) if( this == getParent()->getLeft() ) --- 87,110 ---- } ! /* Effettua una rotazione verso sinistra e restituisce il nuovo nodo genitore (rotazione dd)*/ ! Avlt *Avlt::leftRotate() { Avlt *aux; ! aux = (Avlt *)getRight(); //aux punta al nodo che diverrà la nuova "radice" if( aux ) { + //il sottoalbero sx del nodo puntato da aux viene messo come sottoalbero destro del nodo corrente setRight( getRight()->getLeft() ); if( getRight() ) getRight()->setParent( this ); ! ! //il nodo corrente viene messo alla sx di aux aux->setLeft( this ); + + //viene collegato aux al nuovo padre aux->setParent( getParent() ); ! //viene collegato il nuovo padre di aux ad aux if( getParent() ) if( this == getParent()->getLeft() ) *************** *** 107,116 **** else getParent()->setRight( aux ); ! setParent( aux ); ((Avlt *)(aux->getLeft()))->setFdb(); aux->setFdb(); return aux; } --- 112,124 ---- else getParent()->setRight( aux ); ! ! //il nodo corrente può ora essere collegato al nuovo padre setParent( aux ); + //viene sistemato il Fdb dove potrebbe essere cambiato ovvero nel ramo di sx e nella nuova radice ((Avlt *)(aux->getLeft()))->setFdb(); aux->setFdb(); + //viene restituita la nuova "radice" return aux; } *************** *** 119,139 **** } ! /* Effettua una rotazione verso destra e restituisce il nuovo nodo genitore*/ ! Avlt *Avlt::rightRotate() //ss { Avlt *aux; ! aux = (Avlt *)getLeft(); if( aux ) { setLeft( getLeft()->getRight() ); - if( getLeft() ) getLeft()->setParent( this ); ! aux->setRight( this ); aux->setParent( getParent() ); ! if( getParent() ) if( this == getParent()->getLeft() ) --- 127,150 ---- } ! /* Effettua una rotazione verso destra e restituisce il nuovo nodo genitore (rotazione ss)*/ ! Avlt *Avlt::rightRotate() { Avlt *aux; ! aux = (Avlt *)getLeft(); //aux punta al nodo che diverrà la nuova "radice" if( aux ) { + //il sottoalbero dx del nodo puntato da aux viene messo come sottoalbero sinistro del nodo corrente setLeft( getLeft()->getRight() ); if( getLeft() ) getLeft()->setParent( this ); ! ! //il nodo corrente viene messo alla dx di aux aux->setRight( this ); + + //viene collegato aux al nuovo padre aux->setParent( getParent() ); ! //viene collegato il nuovo padre di aux ad aux if( getParent() ) if( this == getParent()->getLeft() ) *************** *** 142,150 **** getParent()->setRight( aux ); setParent( aux ); ((Avlt *)(aux->getRight()))->setFdb(); aux->setFdb(); ! return aux; } --- 153,164 ---- getParent()->setRight( aux ); + //il nodo corrente può ora essere collegato al nuovo padre setParent( aux ); + //viene sistemato il Fdb dove potrebbe essere cambiato ovvero nel ramo di dx e nella nuova radice ((Avlt *)(aux->getRight()))->setFdb(); aux->setFdb(); ! ! //viene restituita la nuova "radice" return aux; } *************** *** 158,173 **** Avlt *aux; aux = this; ! if(key == getValue()) return this; ! if(key < getValue()) { ! if( getLeft() ) { ((Avlt *)getLeft())->insert(key); ! setFdb(); ! if( getFdb() == 2 ) ! if( key < getLeft()->getValue() ) aux = rightRotate(); ! else { ((Avlt *)(getLeft()))->leftRotate(); --- 172,187 ---- Avlt *aux; aux = this; ! if(key == getValue()) //Se il valore è già presente si esce return this; ! if(key < getValue()) // Se il valore da inserire è < di quello del nodo attuale si inserisce verso sinistra, altrimenti verso destra { ! if( getLeft() ) //Se il nodo corrente ha un figlio sinistro si richiama insert su tale nodo. Altrimenti si crea un nuovo nodo e lo si appende come figlio sinistro { ((Avlt *)getLeft())->insert(key); ! setFdb(); //dopo l'inserimento potrebbe essere cambiato il FdB (notare che questa operazione viene effettuata solo nel ramo percorso per inserire il nodo) ! if( getFdb() == 2 ) //Se l'albero si è sbilanciato a seguito dell'inserimento ! if( key < getLeft()->getValue() ) //Se si è inserito a sinistra-sinistra allora si deve fare una rightrotate per ribilanciare aux = rightRotate(); ! else //Altrimenti si è inserito in sinistra-destra allora si deve fare una leftrotate sul ramo si sinistra seguita da una rightrotate sul ramo di destra (rotazione di tipo sd) { ((Avlt *)(getLeft()))->leftRotate(); *************** *** 185,189 **** } else ! { if( getRight() ) { --- 199,203 ---- } else ! { //si effettuano operazioni simmetriche a sopra if( getRight() ) { *************** *** 329,333 **** aux1 = (Avlt *)successor(); ! if( aux1->getLeft() ) //verificare se non è aux1->getLeft() aux2 = (Avlt *)(aux1->getLeft()); else --- 343,347 ---- aux1 = (Avlt *)successor(); ! if( aux1->getLeft() ) aux2 = (Avlt *)(aux1->getLeft()); else *************** *** 351,355 **** do{ aux2=(Avlt *)(aux2->getParent()); ! if(aux2)//verificare se necessario { aux2->setFdb(); --- 365,369 ---- do{ aux2=(Avlt *)(aux2->getParent()); ! if(aux2) { aux2->setFdb(); *************** *** 422,431 **** bool l, r; l = r = true; ! setFdb(); if( getLeft() ) ! l = ((Avlt *)getLeft())->checkBalance(); if( getRight() ) ! r = ((Avlt *)getRight())->checkBalance(); return l && r && (getFdb()==0 || getFdb()==-1 || getFdb()==1); } --- 436,446 ---- bool l, r; l = r = true; ! setFdb(); //viene prima ricalcolato il bilanciamento if( getLeft() ) ! l = ((Avlt *)getLeft())->checkBalance(); //l inidica se il sottoalbero sinistro è bilanciato if( getRight() ) ! r = ((Avlt *)getRight())->checkBalance();//r inidica se il sottoalbero destro è bilanciato + // restituisce vero se i sottoalberi destro e sinistro sono bilanciati e se il fattore di bilanciamento del nodo corrente è 1, -1 oppure 0 return l && r && (getFdb()==0 || getFdb()==-1 || getFdb()==1); } *************** *** 435,439 **** { vector<Avlt *> v , aux; ! if( getLeft() ) { aux = ((Avlt *)getLeft())->getWrongs(); --- 450,454 ---- { vector<Avlt *> v , aux; ! if( getLeft() ) //vengono aggiunti a v i nodi sbilanciati del sottoalbero sinistro { aux = ((Avlt *)getLeft())->getWrongs(); *************** *** 441,445 **** v.push_back(aux[i]); } ! if( getRight() ) { aux = ((Avlt *)getRight())->getWrongs(); --- 456,460 ---- v.push_back(aux[i]); } ! if( getRight() ) //vengono aggiunti a v i nodi sbilanciati del sottoalbero destro { aux = ((Avlt *)getRight())->getWrongs(); *************** *** 448,452 **** } ! if( getFdb()!=0 && getFdb()!=-1 && getFdb()!=1 ) v.push_back(this); --- 463,467 ---- } ! if( getFdb()!=0 && getFdb()!=-1 && getFdb()!=1 ) //viene aggiunto a v il nodo corrente se è sbilanciato v.push_back(this); Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** bst.cpp 7 Sep 2004 14:37:01 -0000 1.14 --- bst.cpp 7 Sep 2004 17:15:20 -0000 1.15 *************** *** 199,203 **** 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 --- 199,202 ---- *************** *** 210,214 **** } ! void Bst::erase() { --- 209,213 ---- } ! /*Elimina il nodo corrente dall'albero ( viene richiamato da erase(int) ) */ void Bst::erase() { *************** *** 248,253 **** { Bst *aux; ! aux = search( key ); ! if( aux ) { aux->erase(); --- 247,252 ---- { Bst *aux; ! aux = search( key ); //si cerca il nodo da eliminare ! if( aux ) //Se la ricerca ha avuto esito positivo si elimina il nodo { aux->erase(); |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-07 17:15:28
|
Update of /cvsroot/avl/avl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4511 Modified Files: TODO Log Message: Index: TODO =================================================================== RCS file: /cvsroot/avl/avl/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TODO 7 Sep 2004 15:33:42 -0000 1.7 --- TODO 7 Sep 2004 17:15:19 -0000 1.8 *************** *** 1,9 **** Codice: ! - Finire di mettere i commenti in avlt.cpp Documentazione: - - cambiare l'attore nei due diagrammi e esportare le immagini - - ripulire e impaginare --- 1,7 ---- Codice: ! - Finire di mettere i commenti in Avlt::erase() e Bst::erase() Documentazione: - ripulire e impaginare |
From: Patrizio B. <het...@us...> - 2004-09-07 16:34:19
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28756/docs Modified Files: relazione.tex Log Message: finished, lacks images and image impagination only Index: relazione.tex =================================================================== RCS file: /cvsroot/avl/avl/docs/relazione.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** relazione.tex 6 Sep 2004 16:01:52 -0000 1.7 --- relazione.tex 7 Sep 2004 16:33:51 -0000 1.8 *************** *** 109,116 **** L'inserimento in un albero AVL si può dividere in due momenti: nel primo c'è un inserimento identico agli alberi BST, ovvero la ricerca del nodo padre a cui appendere il nuovo nodo come una foglia. Successivamente si deve controllare che l'albero ottenuto non violi le proprietà degli AVL, in quanto, aggiungendo una nuova foglia è possibile che l'altezza di quel ramo dell'albero sia aumentata di uno. Quando un nodo si sbilancia (Fdb= a +/- 2) si possono presentare quattro situazioni, e quindi quattro possibili rotazioni: \begin{itemize} ! \item DD: inserimento nel sotto albero destro di un figlio destro ! \item SD: inserimento nel sotto albero sinistro di un figlio destro ! \item DS: inserimento nel sotto albero destro di un figlio sinistro ! \item SS: inserimento nel sotto albero sinistro di un figlio sinistro \end {itemize} Cosiderando il tipo di bilanciamento considerato la rotazione è un'operazione che fa "girare" i nodi, facendo scendere di livello il nodo sbilanciato e far risalire il nodo centrale: in questo modo i Fdb verranno equilibrati. --- 109,116 ---- L'inserimento in un albero AVL si può dividere in due momenti: nel primo c'è un inserimento identico agli alberi BST, ovvero la ricerca del nodo padre a cui appendere il nuovo nodo come una foglia. Successivamente si deve controllare che l'albero ottenuto non violi le proprietà degli AVL, in quanto, aggiungendo una nuova foglia è possibile che l'altezza di quel ramo dell'albero sia aumentata di uno. Quando un nodo si sbilancia (Fdb= a +/- 2) si possono presentare quattro situazioni, e quindi quattro possibili rotazioni: \begin{itemize} ! \item RR: inserimento nel sotto albero destro di un figlio destro ! \item LR: inserimento nel sotto albero sinistro di un figlio destro ! \item RL: inserimento nel sotto albero destro di un figlio sinistro ! \item LL: inserimento nel sotto albero sinistro di un figlio sinistro \end {itemize} Cosiderando il tipo di bilanciamento considerato la rotazione è un'operazione che fa "girare" i nodi, facendo scendere di livello il nodo sbilanciato e far risalire il nodo centrale: in questo modo i Fdb verranno equilibrati. *************** *** 125,131 **** La figura \ref{fig:ll} visualizza il comportamento della rotazione LL. Il nodo di partenza ha Fdb pari a +1. E' evidente che se l'Fdb fosse uguale a 0 non ci sarebbe bisogno di ribilanciare l'albero in quando, ovunque un nodo venisse inserito, il nuovo Fdb sarebbe pari a +/- 1, compatibile con gli AVL. In questo caso viene inserito un nuovo nodo nel ramo sinistro del sottoalbero sinistro, modificando in +2 il valore del Fdb della radice. A questo punto viene effettuata la rotazione LL: A sale di un livello e B scende, diventando figlio di A. Tuttavia A aveva già due sotto alberi, i cui valori erano sicuramente inferiori a B per la nozione di AVL. Il sotto albero destro di A viene quindi appeso come sottoalbero sinistro di B. Ora l'albero è di nuovo bilanciato. Da notate che sia A che B ora hanno Fdb pari a zero, quindi un successivo inserimento sarà privo di problemi di bilanciamento. ! La rotazione DD lavora in modo simmetrico, ovviamente. ! Si è visto come le rotazioni effettuabili siano quattro, ma in realtà quelle fondamentali sono due: DD e SS, quelle definite "semplici" e DS e SD ("doppie") che non sono altro che una doppia rotazione semplice. \begin{figure}[htbp] \begin{center} --- 125,131 ---- La figura \ref{fig:ll} visualizza il comportamento della rotazione LL. Il nodo di partenza ha Fdb pari a +1. E' evidente che se l'Fdb fosse uguale a 0 non ci sarebbe bisogno di ribilanciare l'albero in quando, ovunque un nodo venisse inserito, il nuovo Fdb sarebbe pari a +/- 1, compatibile con gli AVL. In questo caso viene inserito un nuovo nodo nel ramo sinistro del sottoalbero sinistro, modificando in +2 il valore del Fdb della radice. A questo punto viene effettuata la rotazione LL: A sale di un livello e B scende, diventando figlio di A. Tuttavia A aveva già due sotto alberi, i cui valori erano sicuramente inferiori a B per la nozione di AVL. Il sotto albero destro di A viene quindi appeso come sottoalbero sinistro di B. Ora l'albero è di nuovo bilanciato. Da notate che sia A che B ora hanno Fdb pari a zero, quindi un successivo inserimento sarà privo di problemi di bilanciamento. ! La rotazione RR lavora in modo simmetrico, ovviamente. ! Si è visto come le rotazioni effettuabili siano quattro, ma in realtà quelle fondamentali sono due: RR e LL, quelle definite "semplici" e RL e LR ("doppie") che non sono altro che una doppia rotazione semplice. \begin{figure}[htbp] \begin{center} *************** *** 151,155 **** \end{itemize} In totale il costo di un inserimento è O(log(n)) nel caso peggiore. ! \\ La cancellazione di un nodo AVL è identica a quella in un albero BST, tuttavia soffre degli stessi problemi dell'inserimento: a seguito dell'eliminazione di un nodo l'albero potrebbe essersi sbilanciato. E' quindi necessario ripetere gli stessi controlli di cui si è parlato in precedenza: partire dal nodo più basso del ramo interessato e risalire, bilanciando tutti i nodi con Fdb pari a +/- 2 con rotazioni singole o doppie. --- 151,169 ---- \end{itemize} In totale il costo di un inserimento è O(log(n)) nel caso peggiore. ! ! Ricapitolando: durante l'inserimento lo sbialnciamento è possibile solo nel caso in cui un nodo ha un Fdb pari a +/-1. ! \begin{itemize} ! \item Caso +1: Si sbilancia se viene inserito un nodo nel sotto albero sinistro. ! \begin{itemize} ! \item Se si inserisce nel sotto albero sinistro del nodo figlio sinistro (LL) è necessaria una Right Rotation (semplice). ! \item Se si inserisce nel sotto albero destro del nodo figlio sinistro (LR) è necessaria una Left Rotation e poi una Right Rotation (LR doppia). ! \end{itemize} ! \item Caso -1: Si sbilancia se viene inserito un nodo nel sotto albero destro. ! \begin{itemize} ! \item Se si inserisce nel sotto albero destro del nodo figlio destro (RR) è necessaria una Left Rotation (semplice). ! \item Se si inserisce nel sotto albero sinistro del nodo figlio destro (RL) è necessaria una Right Rotation e poi una Left Rotation (RL doppia). ! \end{itemize} ! \end{itemize} ! La cancellazione di un nodo AVL è identica a quella in un albero BST, tuttavia soffre degli stessi problemi dell'inserimento: a seguito dell'eliminazione di un nodo l'albero potrebbe essersi sbilanciato. E' quindi necessario ripetere gli stessi controlli di cui si è parlato in precedenza: partire dal nodo più basso del ramo interessato e risalire, bilanciando tutti i nodi con Fdb pari a +/- 2 con rotazioni singole o doppie. *************** *** 206,211 **** \item non è sicuro che l'implementazione proposta sia la più performante in entrambi i casi. L'uso di strutture dati differenti, compilatori e ottimizzazioni specifiche per architetture e sistemi operativi potrebbe in qualche modo sbilanciare a favore di una implementazione l'esito dei test. \item la misurazione del tempo impiegato è effettuata tramite chiamate alla funzione "clock()" e il calcolo della differenza tra i due istanti di misurazione. L'accuratezza della differenza non è quindi assicurata. \end{itemize} Alla luce del lavoro effettuato si possono trarre le seguenti conclusioni: ! gli alberi AVL, teoricamente molto più veloci dei semplici BST nelle tre operazioni fondamentali di ricerca, cancellazione e inserimento, nella pratica sono risultati più performanti ma con prestazioni al di sotto dell'aspettiva, fermo restando che dei test più accurati, quantità di input maggiori e specificatamente disegnati per gli AVL possano smentire i risultati ottenuti. \end{document} --- 220,228 ---- \item non è sicuro che l'implementazione proposta sia la più performante in entrambi i casi. L'uso di strutture dati differenti, compilatori e ottimizzazioni specifiche per architetture e sistemi operativi potrebbe in qualche modo sbilanciare a favore di una implementazione l'esito dei test. \item la misurazione del tempo impiegato è effettuata tramite chiamate alla funzione "clock()" e il calcolo della differenza tra i due istanti di misurazione. L'accuratezza della differenza non è quindi assicurata. + \item Nel test comparativo si usano numeri estratti casualmente, ma non gli stessi per entrambi gli alberi. \end{itemize} Alla luce del lavoro effettuato si possono trarre le seguenti conclusioni: ! gli alberi AVL, teoricamente molto più veloci dei semplici BST nelle tre operazioni fondamentali di ricerca, cancellazione e inserimento, nella pratica sono risultati leggermente performanti (e talvolta anche più lenti!) ma con prestazioni al di sotto dell'aspettiva, fermo restando che dei test più accurati, quantità di input maggiori e specificatamente disegnati per gli AVL possano smentire i risultati ottenuti. ! Va sempre considerato anche l'aspetto delle costanti: utilizzando dei set di numeri non immensi, un costo logaritmico, ma con una costante moltiplicativa grande può risultare superiore ad un costo lineare. ! Considerando che nell'implementazione proposta gli alberi AVL derivano dagli alberi BST è possibile che ci sia un overhead dovuto proprio all'esecuzione di questo codice. \end{document} |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-07 15:53:11
|
Update of /cvsroot/avl/avl/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20732/docs Modified Files: application.eps application.png application.xmi Log Message: Index: application.xmi =================================================================== RCS file: /cvsroot/avl/avl/docs/application.xmi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** application.xmi 6 Sep 2004 16:01:52 -0000 1.1 --- application.xmi 7 Sep 2004 15:52:54 -0000 1.2 *************** *** 7,11 **** <XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding> </XMI.documentation> ! <XMI.model xmi.name="umbrelloUwoVza" href="/home/patrizio/.kde3.3/tmp-blight/umbrelloUwoVza.tmp" /> <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" /> </XMI.header> --- 7,11 ---- <XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding> </XMI.documentation> ! <XMI.model xmi.name="umbrelloB6RdHa" href="/tmp/kde-jah/umbrelloB6RdHa.tmp" /> <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" /> </XMI.header> *************** *** 70,74 **** </UML:Association.connection> </UML:Association> ! <UML:Association visibility="public" xmi.id="57" > <UML:Association.connection> <UML:AssociationEndRole visibility="public" aggregation="none" type="53" /> --- 70,74 ---- </UML:Association.connection> </UML:Association> ! <UML:Association visibility="public" xmi.id="57" name="<<create>>" > <UML:Association.connection> <UML:AssociationEndRole visibility="public" aggregation="none" type="53" /> *************** *** 76,99 **** </UML:Association.connection> </UML:Association> - <UML:Association visibility="public" xmi.id="58" > - <UML:Association.connection> - <UML:AssociationEndRole visibility="public" aggregation="none" type="13" /> - <UML:AssociationEndRole visibility="public" isNavigable="true" type="53" /> - </UML:Association.connection> - </UML:Association> </UML:Model> </XMI.content> <XMI.extensions xmi.extender="umbrello" > ! <docsettings viewid="1" documentation="" uniqueid="59" /> <diagrams> ! <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="835" snapy="10" showatts="1" xmi.id="1" documentation="" type="402" showops="1" showpackage="0" name="diagramma delle classi" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="578" > <widgets> <classwidget usesdiagramfillcolour="1" width="37" showattsigs="601" usesdiagramusefillcolour="1" x="667" linecolour="none" y="442" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="11" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> <classwidget usesdiagramfillcolour="1" width="32" showattsigs="601" usesdiagramusefillcolour="1" x="404" linecolour="none" y="440" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="12" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> <classwidget usesdiagramfillcolour="0" width="527" showattsigs="601" usesdiagramusefillcolour="0" x="280" linecolour="#ff0000" y="75" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="288" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="13" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="1" width="41" showattsigs="601" usesdiagramusefillcolour="1" x="13" linecolour="none" y="243" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="53" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <floatingtext usesdiagramfillcolour="1" width="104" usesdiagramusefillcolour="1" x="78" linecolour="none" y="175" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="700" fillcolour="none" height="25" usefillcolor="1" pretext="" isinstance="0" xmi.id="55" text="Test Creation" font="Luxi Sans,14,-1,5,50,0,0,0,0,0" /> ! <floatingtext usesdiagramfillcolour="1" width="8" usesdiagramusefillcolour="1" x="163" linecolour="none" y="203" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="700" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="56" text="" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" /> ! <floatingtext usesdiagramfillcolour="1" width="62" usesdiagramusefillcolour="1" x="139" linecolour="none" y="279" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="700" fillcolour="none" height="25" usefillcolor="1" pretext="" isinstance="0" xmi.id="59" text="Results" font="Luxi Sans,14,-1,5,50,0,0,0,0,0" /> </widgets> <messages/> --- 76,90 ---- </UML:Association.connection> </UML:Association> </UML:Model> </XMI.content> <XMI.extensions xmi.extender="umbrello" > ! <docsettings viewid="1" documentation="" uniqueid="62" /> <diagrams> ! <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="835" snapy="10" showatts="1" xmi.id="1" documentation="" type="402" showops="1" showpackage="0" name="diagramma delle classi" localid="30000" showstereotype="0" showscope="1" snapcsgrid="0" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="583" > <widgets> <classwidget usesdiagramfillcolour="1" width="37" showattsigs="601" usesdiagramusefillcolour="1" x="667" linecolour="none" y="442" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="11" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> <classwidget usesdiagramfillcolour="1" width="32" showattsigs="601" usesdiagramusefillcolour="1" x="404" linecolour="none" y="440" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="1" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="12" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> <classwidget usesdiagramfillcolour="0" width="527" showattsigs="601" usesdiagramusefillcolour="0" x="280" linecolour="#ff0000" y="75" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="288" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="13" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> ! <classwidget usesdiagramfillcolour="0" width="41" showattsigs="601" usesdiagramusefillcolour="1" x="76" linecolour="#000000" y="205" showopsigs="601" linewidth="none" usesdiagramlinewidth="1" usesdiagramlinecolour="0" fillcolour="#28e6ff" height="28" usefillcolor="1" showpubliconly="0" showattributes="0" isinstance="0" xmi.id="53" showoperations="0" showpackage="0" showscope="1" showstereotype="0" font="Luxi Sans,12,-1,5,75,0,0,0,0,0" /> </widgets> <messages/> *************** *** 111,125 **** </linepath> </assocwidget> ! <assocwidget totalcounta="3" indexa="1" totalcountb="3" indexb="1" widgetbid="13" widgetaid="53" xmi.id="57" > ! <linepath> ! <startpoint startx="54" starty="255" /> ! <endpoint endx="280" endy="171" /> ! </linepath> ! </assocwidget> ! <assocwidget totalcounta="3" indexa="2" totalcountb="3" indexb="2" widgetbid="53" widgetaid="13" xmi.id="58" > <linepath> ! <startpoint startx="280" starty="267" /> ! <endpoint endx="54" endy="267" /> </linepath> </assocwidget> </associations> --- 102,111 ---- </linepath> </assocwidget> ! <assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="13" widgetaid="53" xmi.id="57" > <linepath> ! <startpoint startx="117" starty="219" /> ! <endpoint endx="280" endy="219" /> </linepath> + <floatingtext usesdiagramfillcolour="1" width="80" usesdiagramusefillcolour="1" x="153" linecolour="none" y="214" linewidth="none" usesdiagramlinewidth="1" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="62" text="<<create>>" font="Luxi Sans,12,-1,5,50,0,0,0,0,0" /> </assocwidget> </associations> *************** *** 168,172 **** </listitem> </listview> ! <codegeneration/> </XMI.extensions> </XMI> --- 154,975 ---- </listitem> </listview> ! <codegeneration> ! <codegenerator language="Java" > ! <classifiercodedocument writeOutCode="true" package="" id="11" parent_class="11" fileExt=".java" fileName="Avlt" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="11" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Avlt&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Avlt ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="15" field_type="3" initialValue="" role_id="1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="12" parent_class="12" fileExt=".java" fileName="Bst" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="12" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Bst&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Bst ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="16" field_type="3" initialValue="" role_id="1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_0" canDelete="false" writeOutText="false" indentLevel="1" role_id="1" text="public Test = new Test ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_0" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_1" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_2" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Test to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_3" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Test from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_4" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="1" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="13" parent_class="13" fileExt=".java" fileName="Test" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" text="&#010;import Main;&#010;import Test;" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="13" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Test&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks> ! <ccfdeclarationcodeblock parent_id="17" tag="tblock_0" canDelete="false" indentLevel="1" role_id="-1" text="private Avlt* avlt;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="19" tag="tblock_1" canDelete="false" indentLevel="1" role_id="-1" text="private Bst* bst;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="40" tag="tblock_2" canDelete="false" indentLevel="1" role_id="-1" text="private double init_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="41" tag="tblock_3" canDelete="false" indentLevel="1" role_id="-1" text="private double change_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="42" tag="tblock_4" canDelete="false" indentLevel="1" role_id="-1" text="private int tree_dimensions;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_5" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Avlt = new Avlt ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_6" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Bst = new Bst ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Test ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! <codeoperation parent_id="21" tag="operation_21" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" /> ! </header> ! </codeoperation> ! <codeoperation parent_id="23" tag="operation_23" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param kind &#010;@param upperbound &#010;@param base_tree_size " /> ! </header> ! </codeoperation> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="17" tag="hblock_tag_0" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="return avlt;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of avlt&#010;&#010;@return the value of avlt" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="17" tag="hblock_tag_7" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="avlt = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of avlt&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="19" tag="hblock_tag_8" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="return bst;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of bst&#010;&#010;@return the value of bst" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="19" tag="hblock_tag_9" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="bst = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of bst&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="40" tag="hblock_tag_10" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="return init_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of init_timer&#010;&#010;@return the value of init_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="40" tag="hblock_tag_11" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="init_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of init_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="41" tag="hblock_tag_12" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="return change_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of change_timer&#010;&#010;@return the value of change_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="41" tag="hblock_tag_13" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="change_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of change_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="42" tag="hblock_tag_14" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="return tree_dimensions;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of tree_dimensions&#010;&#010;@return the value of tree_dimensions" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="42" tag="hblock_tag_15" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="tree_dimensions = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of tree_dimensions&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_16" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_17" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_18" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Avlt to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_19" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Avlt from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_20" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_21" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_22" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_23" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Bst to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_24" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Bst from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_25" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks> ! <codeoperation parent_id="27" tag="operation_27" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return Avlt* " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="28" tag="operation_28" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return Bst* " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="29" tag="operation_29" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param upper_limit &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="31" tag="operation_31" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param upper_limit &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="33" tag="operation_33" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param base_tree_size &#010;@param upperbound &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="36" tag="operation_36" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@param base_limit &#010;@param kind &#010;@return void " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="43" tag="operation_43" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return double " /> ! </header> ! </codeoperation> ! <codeoperation parent_id="44" tag="operation_44" canDelete="false" indentLevel="1" role_id="-1" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="&#010;@return double " /> ! </header> ! </codeoperation> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields> ! <codeclassfield parent_id="17" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="17" tag="tblock_0" canDelete="false" indentLevel="1" role_id="-1" text="private Avlt* avlt;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="17" tag="hblock_tag_0" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="return avlt;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of avlt&#010;&#010;@return the value of avlt" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="17" tag="hblock_tag_7" canDelete="false" indentLevel="1" classfield_id="17" role_id="-1" text="avlt = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of avlt&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="19" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="19" tag="tblock_1" canDelete="false" indentLevel="1" role_id="-1" text="private Bst* bst;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="19" tag="hblock_tag_8" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="return bst;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of bst&#010;&#010;@return the value of bst" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="19" tag="hblock_tag_9" canDelete="false" indentLevel="1" classfield_id="19" role_id="-1" text="bst = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of bst&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="40" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="40" tag="tblock_2" canDelete="false" indentLevel="1" role_id="-1" text="private double init_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="40" tag="hblock_tag_10" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="return init_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of init_timer&#010;&#010;@return the value of init_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="40" tag="hblock_tag_11" canDelete="false" indentLevel="1" classfield_id="40" role_id="-1" text="init_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of init_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="41" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="41" tag="tblock_3" canDelete="false" indentLevel="1" role_id="-1" text="private double change_timer;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="41" tag="hblock_tag_12" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="return change_timer;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of change_timer&#010;&#010;@return the value of change_timer" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="41" tag="hblock_tag_13" canDelete="false" indentLevel="1" classfield_id="41" role_id="-1" text="change_timer = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of change_timer&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="42" field_type="0" initialValue="" role_id="-1" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="42" tag="tblock_4" canDelete="false" indentLevel="1" role_id="-1" text="private int tree_dimensions;" > ! <header> ! <codecomment tag="" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="42" tag="hblock_tag_14" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="return tree_dimensions;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of tree_dimensions&#010;&#010;@return the value of tree_dimensions" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="42" tag="hblock_tag_15" canDelete="false" indentLevel="1" classfield_id="42" role_id="-1" text="tree_dimensions = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of tree_dimensions&#010;&#010;" /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="15" field_type="3" initialValue="" role_id="0" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="15" tag="tblock_5" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Avlt = new Avlt ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="15" tag="hblock_tag_16" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="15" tag="hblock_tag_17" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="15" tag="hblock_tag_18" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Avlt to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="15" tag="hblock_tag_19" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Avlt from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="15" tag="hblock_tag_20" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="15" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! <codeclassfield parent_id="16" field_type="3" initialValue="" role_id="0" writeOutMethods="true" listClassName="" > ! <header> ! <codecomment tag="" /> ! </header> ! <ccfdeclarationcodeblock parent_id="16" tag="tblock_6" canDelete="false" writeOutText="false" indentLevel="1" role_id="0" text="public Bst = new Bst ( );" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! </ccfdeclarationcodeblock> ! <codeaccessormethod accessType="0" parent_id="16" tag="hblock_tag_21" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the value of &#010;&#010;@return the value of " /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="1" parent_id="16" tag="hblock_tag_22" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=" = value;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Set the value of &#010;&#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="2" parent_id="16" tag="hblock_tag_23" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".add(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Add an object of type Bst to the List &#010;&#010;@return void" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="3" parent_id="16" tag="hblock_tag_24" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text=".remove(value);" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Remove an object of type Bst from the List &#010;" /> ! </header> ! </codeaccessormethod> ! <codeaccessormethod accessType="4" parent_id="16" tag="hblock_tag_25" canDelete="false" writeOutText="false" indentLevel="1" classfield_id="16" role_id="0" text="return (List) ;" > ! <header> ! <javacodedocumentation tag="" indentLevel="1" text="Get the list of &#010;&#010;@return List of " /> ! </header> ! </codeaccessormethod> ! </codeclassfield> ! </classfields> ! </classifiercodedocument> ! <classifiercodedocument writeOutCode="true" package="" id="53" parent_class="53" fileExt=".java" fileName="Main" > ! <textblocks> ! <codeblockwithcomments tag="packages" writeOutText="false" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <codeblockwithcomments tag="imports" text="&#010;import Test;" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <javaclassdeclarationblock parent_id="53" tag="ClassDeclBlock" canDelete="false" role_id="-1" > ! <header> ! <javacodedocumentation tag="" text="Class Main&#010;" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="fieldsDecl" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Fields" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="methodsBlock" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="constructorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Constructors" /> ! </header> ! <textblocks> ! <codeblockwithcomments tag="emptyconstructor" writeOutText="false" indentLevel="1" text="public Main ( ) { }" > ! <header> ! <codecomment tag="" indentLevel="1" text="Empty Constructor" /> ! </header> ! </codeblockwithcomments> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="accessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Accessor Methods" /> ! </header> ! <textblocks> ! <hierarchicalcodeblock tag="staticAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="regularAccessorMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" writeOutText="false" indentLevel="1" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! <hierarchicalcodeblock tag="operationMethods" canDelete="false" indentLevel="1" > ! <header> ! <codecomment tag="" indentLevel="1" text="Operations" /> ! </header> ! <textblocks/> ! </hierarchicalcodeblock> ! </textblocks> ! </hierarchicalcodeblock> ! </textblocks> ! </javaclassdeclarationblock> ! </textblocks> ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! <classfields/> ! </classifiercodedocument> ! <codedocument writeOutCode="false" package="" id="ANTDOC" fileExt=".xml" fileName="build" > ! <textblocks> ! <codeblockwithcomments tag="xmlDecl" text="<?xml version="1.0"?>" > ! <header> ! <codecomment tag="" writeOutText="false" /> ! </header> ! </codeblockwithcomments> ! <xmlelementblock nodeName="project" tag="projectDecl" canDelete="false" > ! <header> ! <codecomment tag="" text="Java ANT build document" /> ! </header> ! <textblocks/> ! </xmlelementblock> ! </textblocks> ! <header> ! <codecomment tag="" /> ! </header> ! </codedocument> ! </codegenerator> ! </codegeneration> </XMI.extensions> </XMI> Index: application.png =================================================================== RCS file: /cvsroot/avl/avl/docs/application.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsJEarB7 and /tmp/cvsSn0aXL differ Index: application.eps =================================================================== RCS file: /cvsroot/avl/avl/docs/application.eps,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** application.eps 6 Sep 2004 16:01:52 -0000 1.1 --- application.eps 7 Sep 2004 15:52:54 -0000 1.2 *************** *** 1,291 **** ! %!PS-Adobe-3.0 EPSF-3.0 ! %%Creator: ImageMagick 6.0.5 ! %%Title: application.eps ! %%CreationDate: Mon Sep 6 17:38:38 2004 ! %%BoundingBox: 0 0 842 443 ! %%HiResBoundingBox: 0 0 842 443 ! %%LanguageLevel: 3 %%Pages: 1 %%EndComments ! %%BeginProlog [...34800 lines suppressed...] ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ! ffffffffffffffffffffffffffffffffffffffffff ! grestore ! showpage %%Trailer |
From: Patrizio B. <het...@us...> - 2004-09-07 15:33:57
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17393/src Modified Files: Makefile avl.cpp test.cpp Log Message: wow, pretty finished! Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** avl.cpp 7 Sep 2004 14:37:01 -0000 1.15 --- avl.cpp 7 Sep 2004 15:33:42 -0000 1.16 *************** *** 25,30 **** int choice=0; ! int base_tree=20; ! int upperbound=2; Test *prova=NULL; Avlt* aux_avl=NULL; --- 25,30 ---- int choice=0; ! int base_tree=10000; ! int upperbound=1000; Test *prova=NULL; Avlt* aux_avl=NULL; *************** *** 54,57 **** --- 54,61 ---- upperbound=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton2)); + // 0= test avl + // 1= test bst + // 2= test comparativo + if (choice==0) { prova = new Test(0,upperbound,base_tree); *************** *** 73,108 **** prova = new Test(2,upperbound,base_tree); ! GtkWidget *scrolled_window; ! GtkWidget *tree_view; ! GtkTreeIter iter1; ! GtkTreeStore *store; ! GtkCellRenderer *cell; ! GtkTreeViewColumn *column; ! //creo una contenitore che sia scrollabile ! scrolled_window = gtk_scrolled_window_new (NULL, NULL); ! gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); ! ! //creo il contenitore dell'albero ! store=gtk_tree_store_new(1,G_TYPE_STRING); ! //creo l'albero e lo lego al contenitore ! tree_view = gtk_tree_view_new (); ! gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), tree_view); ! ! //link dell'albero e il suo contenitore ! gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (store)); ! gtk_widget_show (tree_view); ! ! gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,NULL); ! gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, "Empty tree, comparation selected", -1); ! //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. ! cell = gtk_cell_renderer_text_new (); ! column = gtk_tree_view_column_new_with_attributes ("No Trees",cell,"text", 0, NULL); ! gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column)); ! ! gtk_widget_destroy(node_list); ! node_list=scrolled_window; } --- 77,93 ---- prova = new Test(2,upperbound,base_tree); ! GtkWidget *box1; ! GtkWidget *view; ! box1 = gtk_vbox_new (FALSE, 0); ! gtk_container_add (GTK_CONTAINER (vpaned1), box1); ! gtk_widget_show (box1); ! view= gtk_label_new ("Tree display disabled\nComparation test choosen"); ! gtk_container_add (GTK_CONTAINER (box1), view); ! gtk_widget_show (view); ! gtk_widget_destroy(node_list); ! node_list=box1; } *************** *** 150,156 **** } #endif ! int main(int argc, char *argv[]) { - // 0= test avl // 1= test bst --- 135,144 ---- } #endif ! #ifdef GUI ! int main (int argc, char *argv[]) ! #else ! int main () ! #endif { // 0= test avl // 1= test bst *************** *** 159,163 **** #ifndef GUI ! printf("Welcome to AVL/BST test program\nYou will be asked for values, no controls on your imput, so be careful!\n"); printf("What do you want to test? AVL=0 BST=1 Comparation=2\n"); scanf("%d",&choice); --- 147,151 ---- #ifndef GUI ! printf("Welcome to AVL/BST test program\nYou will be asked for values, no controls on your input, so be careful!\n"); printf("What do you want to test? AVL=0 BST=1 Comparation=2\n"); scanf("%d",&choice); *************** *** 205,209 **** gtk_window_set_title (GTK_WINDOW (window), fullname); ! gtk_widget_set_usize(window, (int)gdk_screen_width()*0.75, (int)gdk_screen_height()*0.75); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); --- 193,197 ---- gtk_window_set_title (GTK_WINDOW (window), fullname); ! gtk_widget_set_usize(window, (int)(gdk_screen_width()*3/4), (int)(gdk_screen_height()*3/4)); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); Index: Makefile =================================================================== RCS file: /cvsroot/avl/avl/src/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 7 Sep 2004 10:40:17 -0000 1.7 --- Makefile 7 Sep 2004 15:33:42 -0000 1.8 *************** *** 2,7 **** ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI -g ! #CC=g++ `pkg-config gtk+-2.0 --cflags` -DGUI else CC=g++ -O2 -Wall -W --- 2,6 ---- ifdef gtk_gui ! CC=g++ -O2 -Wall -W `pkg-config gtk+-2.0 --cflags` -DGUI else CC=g++ -O2 -Wall -W *************** *** 31,34 **** --- 30,34 ---- $(BINARY): $(LIBS) $(CC) -o $(BINARY) $(LIBS) $(GTKLIBS) + strip $(BINARY) clean: *************** *** 38,41 **** --- 38,43 ---- make library $(CC) avl.cpp -o $(BINARY) libavl.a test.o + strip $(BINARY) + strip libavl.a library: Index: test.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/test.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test.cpp 7 Sep 2004 14:37:01 -0000 1.12 --- test.cpp 7 Sep 2004 15:33:42 -0000 1.13 *************** *** 44,54 **** int random; clock_t start, end; GtkWidget *dialog; ! srand ( time(NULL) ); if (avlt && kind==0) { start = clock(); for (int i=0;i<base_limit;i++) { ! random=rand()%tree_dimensions; avlt=avlt->insert(random); } --- 44,56 ---- int random; clock_t start, end; + #ifdef GUI GtkWidget *dialog; ! #endif ! srand ( time(NULL) ); if (avlt && kind==0) { start = clock(); for (int i=0;i<base_limit;i++) { ! random=rand()%(tree_dimensions*10); avlt=avlt->insert(random); } *************** *** 67,71 **** start = clock(); for (int i=0;i<base_limit;i++) { ! random=rand()%tree_dimensions; bst->insert(random); } --- 69,73 ---- start = clock(); for (int i=0;i<base_limit;i++) { ! random=rand()%(tree_dimensions*10); bst->insert(random); } *************** *** 92,96 **** --- 94,100 ---- clock_t start, end; int waste=0; + #ifdef GUI GtkWidget *dialog; + #endif srand ( time(NULL) ); *************** *** 99,103 **** start=clock(); for (int i=0;i<upper_limit;i++) { ! random=rand()%tree_dimensions; decision=rand()%2; if (decision==0) { --- 103,107 ---- start=clock(); for (int i=0;i<upper_limit;i++) { ! random=rand()%(tree_dimensions*10); decision=rand()%2; if (decision==0) { *************** *** 138,142 **** --- 142,148 ---- clock_t start, end; int waste=0; + #ifdef GUI GtkWidget *dialog; + #endif srand ( time(NULL) ); *************** *** 144,148 **** start=clock(); for (int i=0;i<upper_limit;i++) { ! random=rand()%tree_dimensions; decision=rand()%2; if (decision==0) { --- 150,154 ---- start=clock(); for (int i=0;i<upper_limit;i++) { ! random=rand()%(tree_dimensions*10); decision=rand()%2; if (decision==0) { *************** *** 176,180 **** --- 182,190 ---- double temp_timer,search_timer; clock_t start, end; + + #ifdef GUI GtkWidget *dialog=NULL; + #endif + bst=new Bst(); avlt=new Avlt(); |
From: Patrizio B. <het...@us...> - 2004-09-07 15:33:56
|
Update of /cvsroot/avl/avl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17393 Modified Files: ChangeLog TODO Log Message: wow, pretty finished! Index: TODO =================================================================== RCS file: /cvsroot/avl/avl/TODO,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TODO 6 Sep 2004 14:12:05 -0000 1.6 --- TODO 7 Sep 2004 15:33:42 -0000 1.7 *************** *** 1,12 **** Codice: - - Controllare e fixare i punti in cui freeza. dovrebbe essere in bst. non è solo quando l'albero è vuoto. - Finire di mettere i commenti in avlt.cpp - - controllare dove la stampa GTK perde i nodi (certe volte...) - Documentazione: ! - ripulire e impaginare ! - aggiungere documentazione codice --- 1,9 ---- Codice: - Finire di mettere i commenti in avlt.cpp Documentazione: ! - cambiare l'attore nei due diagrammi e esportare le immagini ! - ripulire e impaginare Index: ChangeLog =================================================================== RCS file: /cvsroot/avl/avl/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChangeLog 6 Sep 2004 14:12:05 -0000 1.8 --- ChangeLog 7 Sep 2004 15:33:42 -0000 1.9 *************** *** 1,2 **** --- 1,13 ---- + --==07.09.2004==-- + <hetfield666>: + - Added Complete GTK GUI + - Added PopUp windows + - Added strip option to Makefile + - Some cleaning and cosmetics + + --==07.09.2004==-- + <jah2003>: + - fixed initialization bug with GTK + --==06.09.2004==-- <hetfield666>: |
From: Patrizio B. <het...@us...> - 2004-09-07 14:37:11
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7379 Modified Files: avl.cpp bst.cpp test.cpp test.h Log Message: completed gtk gui and list-> vector conversion Index: test.h =================================================================== RCS file: /cvsroot/avl/avl/src/test.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test.h 6 Sep 2004 13:16:36 -0000 1.9 --- test.h 7 Sep 2004 14:37:01 -0000 1.10 *************** *** 25,29 **** #include <time.h> ! #include <list> #include <algorithm> --- 25,29 ---- #include <time.h> ! #include <vector> #include <algorithm> Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bst.cpp 7 Sep 2004 13:03:21 -0000 1.13 --- bst.cpp 7 Sep 2004 14:37:01 -0000 1.14 *************** *** 491,495 **** //needed workaround - aggiungo un primo elemento root gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,NULL); ! gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, "Here Begins AVL Tree Diplay", -1); //prendo la root e stampo tutto l'albero, appendo il primo valore e poi ricorsivamente tutti gli altri --- 491,495 ---- //needed workaround - aggiungo un primo elemento root gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,NULL); ! gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, "Here Begins Tree Diplay", -1); //prendo la root e stampo tutto l'albero, appendo il primo valore e poi ricorsivamente tutti gli altri *************** *** 505,509 **** //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); ! column = gtk_tree_view_column_new_with_attributes ("AVL Tree",cell,"text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column)); --- 505,509 ---- //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); ! column = gtk_tree_view_column_new_with_attributes ("Tree",cell,"text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column)); Index: test.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test.cpp 7 Sep 2004 10:40:17 -0000 1.11 --- test.cpp 7 Sep 2004 14:37:01 -0000 1.12 *************** *** 22,27 **** Test::~Test() { ! //if (avlt) delete avlt; ! //if (bst) delete bst; } --- 22,26 ---- Test::~Test() { ! } *************** *** 45,48 **** --- 44,48 ---- int random; clock_t start, end; + GtkWidget *dialog; srand ( time(NULL) ); *************** *** 55,59 **** --- 55,65 ---- end = clock(); init_timer = ((double) (end - start)) / CLOCKS_PER_SEC; + #ifndef GUI printf("AVL Initialization of %d items tree took %lf seconds\n",base_limit,init_timer); + #else + dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "AVL Initialization of %d items tree took %lf seconds\n",base_limit,init_timer); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + #endif } *************** *** 66,70 **** --- 72,82 ---- end = clock(); init_timer = ((double) (end - start)) / CLOCKS_PER_SEC; + #ifndef GUI printf("BST Initialization of %d items tree took %lf seconds\n",base_limit,init_timer); + #else + dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "BST Initialization of %d items tree took %lf seconds\n",base_limit,init_timer); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + #endif } } *************** *** 77,85 **** int random_erase; int erase_counter=0,insert_counter=0; ! list<int>::iterator IT; ! list<int> insertion_list; ! int x; clock_t start, end; int waste=0; srand ( time(NULL) ); --- 89,97 ---- int random_erase; int erase_counter=0,insert_counter=0; ! vector<int> insertion_list; clock_t start, end; int waste=0; + GtkWidget *dialog; + srand ( time(NULL) ); *************** *** 97,114 **** random_erase=rand()%insertion_list.size(); ! ! for ( IT=insertion_list.begin(), x=0; x<=random_erase && IT!=insertion_list.end(); ! IT++, x++) ! { ! if (x==random_erase) { ! //printf("x:%d value=%d\n",x,*IT); ! // printf("erased number %d\n",*IT); ! if (IT!=insertion_list.end()){ ! avlt=avlt->erase(*IT); ! insertion_list.erase(IT); ! } ! erase_counter++; ! } ! } } else waste++; --- 109,115 ---- random_erase=rand()%insertion_list.size(); ! avlt=avlt->erase(insertion_list[random_erase]); ! insertion_list.erase(insertion_list.begin()+random_erase); ! erase_counter++; } else waste++; *************** *** 117,122 **** end=clock(); change_timer = ((double) (end - start)) / CLOCKS_PER_SEC; printf("AVL TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted:%d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! } --- 118,128 ---- end=clock(); change_timer = ((double) (end - start)) / CLOCKS_PER_SEC; + #ifndef GUI printf("AVL TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted:%d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! #else ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"AVL TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted:%d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! #endif } *************** *** 129,137 **** int random_erase; int erase_counter=0,insert_counter=0; ! list<int>::iterator IT; ! list<int> insertion_list; ! int x; clock_t start, end; int waste=0; srand ( time(NULL) ); --- 135,142 ---- int random_erase; int erase_counter=0,insert_counter=0; ! vector<int> insertion_list; clock_t start, end; int waste=0; + GtkWidget *dialog; srand ( time(NULL) ); *************** *** 149,175 **** random_erase=rand()%insertion_list.size(); ! for ( IT=insertion_list.begin(), x=0; x<=random_erase && IT!=insertion_list.end();IT++, x++) ! { ! if (x==random_erase) { ! //printf("x:%d value=%d\n",x,*IT); ! // printf("erased number %d\n",*IT); ! if (IT!=insertion_list.end()){ ! //bst->erase(*IT); ! //printf("%d\n",*IT); ! insertion_list.erase(IT); ! } ! ! erase_counter++; ! } ! } } else waste++; } end=clock(); change_timer = ((double) (end - start)) / CLOCKS_PER_SEC; ! printf("BST TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted %d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! } - } //questo metodo fa un confronto delle prestazioni di un AVL e un BST void Test::comparation(int base_tree_size, int upperbound ) { --- 154,174 ---- random_erase=rand()%insertion_list.size(); ! bst->erase(insertion_list[random_erase]); ! insertion_list.erase(insertion_list.begin()+random_erase); ! erase_counter++; } else waste++; } end=clock(); change_timer = ((double) (end - start)) / CLOCKS_PER_SEC; ! #ifndef GUI ! printf("BST TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted:%d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! #else ! dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST TEST RESULTS:\n%d insertions and %d deletions took %lf seconds.\nTotal of %d cycles, wasted:%d\n",insert_counter,erase_counter,change_timer,upper_limit,waste); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! #endif } } + //questo metodo fa un confronto delle prestazioni di un AVL e un BST void Test::comparation(int base_tree_size, int upperbound ) { *************** *** 177,181 **** double temp_timer,search_timer; clock_t start, end; ! bst=new Bst(); avlt=new Avlt(); --- 176,180 ---- double temp_timer,search_timer; clock_t start, end; ! GtkWidget *dialog=NULL; bst=new Bst(); avlt=new Avlt(); *************** *** 185,200 **** sleep(5); Test_Init(base_tree_size,0); //avl printf("\nInit Result:\nBST -> %lf, AVL -> %lf\n",temp_timer,getInitTimer()); if ((temp_timer-getInitTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-getInitTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-getInitTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); Bst_Test(upperbound); temp_timer=getChangeTimer(); sleep(5); Avl_Test(upperbound); if ((temp_timer-getChangeTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-getChangeTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-getChangeTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); ! int max=bst->max()->getValue(); //caching! --- 184,215 ---- sleep(5); Test_Init(base_tree_size,0); //avl + #ifndef GUI printf("\nInit Result:\nBST -> %lf, AVL -> %lf\n",temp_timer,getInitTimer()); if ((temp_timer-getInitTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-getInitTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-getInitTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); + #else + if ((temp_timer-getInitTimer())>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nAVL faster\n***************************\n",temp_timer,getInitTimer()); + if ((temp_timer-getInitTimer())<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nBST faster\n***************************\n",temp_timer,getInitTimer()); + if ((temp_timer-getInitTimer())==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Init Result:\nBST -> %lf, AVL -> %lf\n***************************\nNo real differences found\n***************************\n",temp_timer,getInitTimer()); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + #endif Bst_Test(upperbound); temp_timer=getChangeTimer(); sleep(5); Avl_Test(upperbound); + #ifndef GUI + printf("Random modification test\n"); if ((temp_timer-getChangeTimer())>double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-getChangeTimer())<double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-getChangeTimer())==double(0)) printf("***************************\nNo real differences found\n***************************\n"); ! #else ! if ((temp_timer-getChangeTimer())>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nAVL faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nBST faster\n***************************\n"); ! if ((temp_timer-getChangeTimer())==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"Random modification test\n***************************\nNo real differences found\n***************************\n"); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! #endif int max=bst->max()->getValue(); //caching! *************** *** 209,217 **** end=clock(); temp_timer=((double) (end - start)) / CLOCKS_PER_SEC; ! printf("Bst search time of its max value (%d):%lf\nBst search time of its max value (%d):%lf\n",bst->max()->getValue(),search_timer,max,temp_timer); if ((temp_timer-search_timer)<double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-search_timer)>double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-search_timer)==double(0)) printf("***************************\nNo real differences found\n***************************\n"); ! } --- 224,239 ---- end=clock(); temp_timer=((double) (end - start)) / CLOCKS_PER_SEC; ! #ifndef GUI ! printf("BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n",bst->max()->getValue(),search_timer,max,temp_timer); if ((temp_timer-search_timer)<double(0)) printf("***************************\nAVL faster\n***************************\n"); if ((temp_timer-search_timer)>double(0)) printf("***************************\nBST faster\n***************************\n"); if ((temp_timer-search_timer)==double(0)) printf("***************************\nNo real differences found\n***************************\n"); ! #else ! if ((temp_timer-search_timer)<double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nAVL faster\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); ! if ((temp_timer-search_timer)>double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nBST faster\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); ! if ((temp_timer-search_timer)==double(0)) dialog=gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,"BST search time of its max value (%d):%lf\nAVL search time of its max value (%d):%lf\n***************************\nNo real differences found\n***************************\n",bst->max()->getValue(),search_timer,max,temp_timer); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! #endif } Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** avl.cpp 7 Sep 2004 13:03:21 -0000 1.14 --- avl.cpp 7 Sep 2004 14:37:01 -0000 1.15 *************** *** 24,40 **** using namespace std; - void p(){ - Avlt* av=new Avlt(); - - - for (int i=0;i<1500;i++) { - - av->insert(i); - } - - - } - - int choice=0; int base_tree=20; --- 24,27 ---- *************** *** 64,93 **** void start() { - //Test *prova; - //prova= new Test(); - //Avlt* aux_avl=NULL; - //Bst* aux_bst=NULL; - base_tree=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton1)); upperbound=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton2)); - printf("%d %d %d\n", choice,base_tree, upperbound ); - /* if (choice==0) { - printf("Processing AVL, wait\n"); prova = new Test(0,upperbound,base_tree); aux_avl=prova->getAvlt(); ! printf("Processing AVL2, wait\n"); ! return; } if (choice==1) { prova = new Test(1,upperbound,base_tree); aux_bst=prova->getBst(); } if (choice==2) { ! prova = new Test(2,upperbound,base_tree); ! } ! */ GtkWidget *scrolled_window; GtkWidget *tree_view; --- 51,76 ---- void start() { base_tree=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton1)); upperbound=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton2)); if (choice==0) { prova = new Test(0,upperbound,base_tree); aux_avl=prova->getAvlt(); ! gtk_widget_destroy(node_list); ! node_list = aux_avl->print_best_look(); } + if (choice==1) { prova = new Test(1,upperbound,base_tree); aux_bst=prova->getBst(); + gtk_widget_destroy(node_list); + node_list = aux_bst->print_best_look(); } + if (choice==2) { ! ! prova = new Test(2,upperbound,base_tree); ! GtkWidget *scrolled_window; GtkWidget *tree_view; *************** *** 113,132 **** gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,NULL); ! gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, "Prova", -1); //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); ! column = gtk_tree_view_column_new_with_attributes ("AVL Tree",cell,"text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column)); gtk_widget_destroy(node_list); node_list=scrolled_window; ! //if (choice==0) node_list = aux_avl->print_best_look(); ! // if (choice==1) node_list = aux_bst->print_best_look(); ! ! gtk_paned_add1 (GTK_PANED (vpaned1), node_list); ! gtk_widget_show (node_list); ! gtk_widget_show (vpaned1); } --- 96,114 ---- gtk_tree_store_append (GTK_TREE_STORE (store), &iter1,NULL); ! gtk_tree_store_set (GTK_TREE_STORE (store), &iter1, 0, "Empty tree, comparation selected", -1); //finalizzazione: creo una cella e metto in una colonna, che poi metto nell'albero. cell = gtk_cell_renderer_text_new (); ! column = gtk_tree_view_column_new_with_attributes ("No Trees",cell,"text", 0, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column)); gtk_widget_destroy(node_list); node_list=scrolled_window; + } ! gtk_paned_add1 (GTK_PANED (vpaned1), node_list); ! gtk_widget_show (node_list); ! gtk_widget_show (vpaned1); ! } *************** *** 215,224 **** GtkAdjustment *adj=NULL; GtkWidget *label=NULL; ! //Test *a=new Test(); ! //p(); gtk_init (&argc, &argv); ! p(); ! //Test *a=new Test(); ! char* fullname="AVL Tree Visualization"; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); --- 197,204 ---- GtkAdjustment *adj=NULL; GtkWidget *label=NULL; ! gtk_init (&argc, &argv); ! ! char* fullname="AVL-BST Tree Visualization"; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); *************** *** 332,338 **** gtk_main (); - #endif ! return EXIT_SUCCESS; } --- 312,317 ---- gtk_main (); #endif ! return EXIT_SUCCESS; } |
From: Gianlorenzo D\\'A. <ja...@us...> - 2004-09-07 13:03:36
|
Update of /cvsroot/avl/avl/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20647 Modified Files: avl.cpp avlt.cpp bst.cpp Log Message: Index: avlt.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avlt.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** avlt.cpp 6 Sep 2004 14:12:06 -0000 1.8 --- avlt.cpp 7 Sep 2004 13:03:21 -0000 1.9 *************** *** 177,181 **** else { ! setLeft(new Avlt); getLeft()->setParent(this); getLeft()->setValue(key); --- 177,181 ---- else { ! setLeft(new Avlt()); getLeft()->setParent(this); getLeft()->setValue(key); *************** *** 201,205 **** else { ! setRight(new Avlt); getRight()->setParent(this); getRight()->setValue(key); --- 201,205 ---- else { ! setRight(new Avlt()); getRight()->setParent(this); getRight()->setValue(key); *************** *** 258,262 **** else { ! aux2->setLeft(new Avlt); aux2->getLeft()->setParent(aux2); aux2->getLeft()->setValue(key); --- 258,262 ---- else { ! aux2->setLeft(new Avlt()); aux2->getLeft()->setParent(aux2); aux2->getLeft()->setValue(key); *************** *** 279,283 **** else { ! aux2->setRight(new Avlt); aux2->getRight()->setParent(aux2); aux2->getRight()->setValue(key); --- 279,283 ---- else { ! aux2->setRight(new Avlt()); aux2->getRight()->setParent(aux2); aux2->getRight()->setValue(key); Index: bst.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/bst.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** bst.cpp 7 Sep 2004 11:53:10 -0000 1.12 --- bst.cpp 7 Sep 2004 13:03:21 -0000 1.13 *************** *** 22,32 **** Bst::Bst() { ! Bst(0); } Bst::Bst(int val) { ! value = val; ! left = right = parent = NULL; } --- 22,38 ---- Bst::Bst() { ! //Bst(0); ! setValue(0); ! setLeft(NULL); ! setRight(NULL); ! setParent(NULL); } Bst::Bst(int val) { ! setValue(val); ! setLeft(NULL); ! setRight(NULL); ! setParent(NULL); } *************** *** 176,186 **** aux1 = this; aux2 = NULL; ! while( aux1 ) //ricerca del nodo ! { 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() ) aux1 = aux1->getLeft(); --- 182,193 ---- aux1 = this; aux2 = NULL; ! while( aux1 ) //ricerca del nodo ! { 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() ) aux1 = aux1->getLeft(); *************** *** 188,192 **** aux1 = aux1->getRight(); } ! // viene istanziato il nuovo nodo e gli viene assegnato key come valore e aux2 come genitore aux1 = new Bst( key ); --- 195,199 ---- aux1 = aux1->getRight(); } ! // viene istanziato il nuovo nodo e gli viene assegnato key come valore e aux2 come genitore aux1 = new Bst( key ); *************** *** 195,202 **** // il nuovo nodo viene appeso a sinistra o a destra di aux2 in base al suo valore ! if ( key < aux2->getValue() ) ! aux2->setLeft( aux1 ); ! else ! aux2->setRight( aux1 ); } --- 202,210 ---- // il nuovo nodo viene appeso a sinistra o a destra di aux2 in base al suo valore ! if(aux2) ! if ( key < aux2->getValue() ) ! aux2->setLeft( aux1 ); ! else ! aux2->setRight( aux1 ); } Index: avl.cpp =================================================================== RCS file: /cvsroot/avl/avl/src/avl.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** avl.cpp 7 Sep 2004 11:53:10 -0000 1.13 --- avl.cpp 7 Sep 2004 13:03:21 -0000 1.14 *************** *** 25,34 **** void p(){ ! Bst* bst=new Bst(); for (int i=0;i<1500;i++) { ! bst->insert(i); } --- 25,34 ---- void p(){ ! Avlt* av=new Avlt(); for (int i=0;i<1500;i++) { ! av->insert(i); } |