arvore avl!

This commit is contained in:
Felipe Domingos 2021-11-23 10:07:49 -03:00
parent dea0b4ce77
commit f39a412024
2 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,6 @@
} else {
i.esq = maiorEsq(i, i.esq);
}
return balancear(i);
}
@ -223,7 +222,7 @@
}
private No rotacionarDir(No no) {
//System.out.println("Rotacionar DIR(" + no.elemento + ")");
System.out.println("Rotacionar DIR(" + no.elemento + ")");
No noEsq = no.esq;
No noEsqDir = noEsq.dir;
@ -237,7 +236,7 @@
}
private No rotacionarEsq(No no) {
//System.out.println("Rotacionar ESQ(" + no.elemento + ")");
System.out.println("Rotacionar ESQ(" + no.elemento + ")");
No noDir = no.dir;
No noDirEsq = noDir.esq;

View File

@ -7,6 +7,7 @@ public class Principal {
try {
AVL avl = new AVL();
int array[] = {4,35,10,13,3,30,15,12,7,40,20};
//int array[] = {1,2,3,4,5,6,7,8,9,10};
for(int item: array){
System.out.println("Inserindo -> " + item);
avl.inserir(item);