Buscar

Complete the code below, replacing the 'X' and 'Y' with the necessary commands to perform a selection sort algorithm on a given list: X: while li...

Complete the code below, replacing the 'X' and 'Y' with the necessary commands to perform a selection sort algorithm on a given list:


X: while lista[j] < menor]: Y: index_menor =j
X: if lista[j] < lista[index_menor]: Y: index_menor =j
X: for i in range(len(lista)): Y: for j in range(i+1, len(lista)):

Essa pergunta também está no material:

Os algoritmos e os tipos de dados
1 pág.

Linguagem de Programação. AnhangueraAnhanguera

💡 1 Resposta

User badge image

Ed Verified user icon

X: while i < len(lista): Y: index_menor = i X: for j in range(i+1, len(lista)): Y: if lista[j] < lista[index_menor]: Y: index_menor = j X: if index_menor != i: Y: lista[i], lista[index_menor] = lista[index_menor], lista[i]

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