Skip to content

Instantly share code, notes, and snippets.

@pvsousalima
Created December 19, 2012 19:31
Show Gist options
  • Save pvsousalima/4339722 to your computer and use it in GitHub Desktop.
Save pvsousalima/4339722 to your computer and use it in GitHub Desktop.
int TentaAVL(Arvore Raiz){
if(Raiz==NULL){
return;
} else {
int Balanceamento = altura(Raiz->direita) - altura(Raiz->esquerda);
if ((Balanceamento>=2)||(Balanceamento<=-2)){
return 0;
}
TentaAVL(Raiz->direita);
TentaAVL(Raiz->esquerda);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment