Questão 1115818

Tecnologia da Informação · 2022

Questão

ID 1115818

Disciplina: Tecnologia da Informação

Assunto: Bubble Sort (2 a 2)

Ano: 2022 Banca: FCC - Fundação Carlos Chagas Órgão: Procuradoria-Geral do Estado - PGE MA


Considere a classe abaixo.

public class Exemplo1 {

public static void main(String[] args) {

int[] v = {4, 10, 2, 7};

int i, j, x, t, max;

max = v.length;

for (i = 0; i <= max - 1; i++) {

for (j = 0; j <= max - i; j++) {

if (v[j] > v[j + 1]) {

x = v[j];

v[j] = v[j + 1];

v[j + 1] = x;

}

}

}

}

}

Ao executar a classe,

Alternativas da questão 1115818
Pular para o conteúdo principal