Esempio n. 1
0
Node* rotacionar(Node* no, int valor){
	Node* noPai;
	int fatorBalanceamento;
	//int fatorBalanceamentoPai = getFatorBalanceamento(altura);
    
    if (no != NULL){
        if (no->valor == valor){
			no->altura = getAltura(no); 
			fatorBalanceamento = getFatorBalanceamento(no, altura);
			
			if (isBalanceado(fatorBalanceamento) != 1){
				getRotacao();		
			}
        }
        else if (no->valor > valor){
			noPai = getPai(no, valor);
            return remover(no->sae, valor);
        }
        else{
			noPai = getPai(no, valor);
            return remover(no->sad, valor);
        }
    }
    return no;	
}
Esempio n. 2
0
bool Retangulo::e_quadrado() {
	return (getAltura()==getLargura());
}