Buscar

What is the algorithm for inserting a node in a list L? The insertion algorithm has a complexity of O(n). The insertion algorithm depends on the s...

What is the algorithm for inserting a node in a list L?

The insertion algorithm has a complexity of O(n).
The insertion algorithm depends on the search algorithm.
The insertion algorithm may cause overflow.
The insertion algorithm may cause underflow.
a) I and II are correct.
b) II and III are correct.
c) III and IV are correct.
d) I and IV are correct.

Essa pergunta também está no material:

Estrutura de Dados e Seus Algoritmos 2ed
326 pág.

Fisiologia do Exercício Universidade Estácio de SáUniversidade Estácio de Sá

💡 1 Resposta

User badge image

Ed Verified user icon

O algoritmo para inserir um nó em uma lista L é o seguinte: 1. Verificar se a lista está vazia. Se estiver, o novo nó se torna o primeiro nó da lista. 2. Se a lista não estiver vazia, percorrer a lista até encontrar o último nó. 3. O último nó da lista aponta para o novo nó. 4. O novo nó aponta para NULL. A alternativa correta é a letra d) I e IV estão corretas.

0
Dislike0

✏️ 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