Buscar

Considering the following AVL tree, with the insertion of the key 90, mark the option that indicates exactly what will happen to the resulting tree...

Considering the following AVL tree, with the insertion of the key 90, mark the option that indicates exactly what will happen to the resulting tree after this insertion:


a) The resulting tree will unbalance to the left of the node with key 10.
b) The resulting tree will unbalance to the right of the node with key 80.
c) The resulting tree will maintain the overall balance of the tree.
d) The resulting tree will unbalance to the right of the node with key 40.
e) The resulting tree will unbalance to the left of the node with key 60.

Essa pergunta também está no material:

Simulado02 - ESTRUTURA DE DADOS EM PYTHON
6 pág.

Programação Python Universidade Estácio de SáUniversidade Estácio de Sá

💡 1 Resposta

User badge image

Ed Verified user icon

A alternativa correta é a letra D) A árvore resultante ficará desbalanceada para a direita do nó com chave 40. Após a inserção da chave 90, a árvore ficará assim: ``` 50 / \ 30 70 / \ / \ 20 40 60 80 \ 90 ``` Observe que o nó com chave 40 tem um fator de balanceamento de 2, pois sua subárvore direita tem altura 2 e sua subárvore esquerda tem altura 0. Portanto, a árvore ficará desbalanceada para a direita do nó com chave 40.

0
Dislike0

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você também pode ser Premium ajudando estudantes

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais