Pular para o conteúdo principal

Questão de Arquitetura de Software — Software — FCC 2023

Arquitetura de SoftwareSoftware
Código
fc070432
Banca
FCC
Órgão
TRT - 21ª Região (RN)
Ano
2023
Nível
Superior
Cargo
Analista Judiciário - Área: Apoio Especializado - Tecnologia da Informação
Considere o método abaixo, em uma aplicação Java, em condições ideais.public static void ordenar (int [] vetor) {for (int i = 0; i <vetor.length - 1; i++) {int indiceMaior = i;for (int j = i + 1; j <vetor.length; j++) {...I...}int temp = vetor [indiceMaior] ;vetor [indiceMaior] = vetor [i];vetor [1] = temp;}}Para que o método ordenar ordene o vetor recebido em ordem decrescente, a lacuna 1 deve ser preenchida por
  1. Aif(vetor [j] < vetor [indiceMaior]) {indiceMaior = j;}
  2. Bif (vetor[j] <= vetor [indiceMaior]) [indiceMaior = i;}
  3. Cif(vetor [j] > vetor [indiceMaior]) (indiceMaior = j;}
  4. Dif(vetor [j] > vetor [indiceMaior]) (indiceMaior = i;}
  5. Eif(vetor [i] > vetor [indiceMaior]) (indiceMaior = j;}
Revelar gabarito e comentário

GabaritoC — if(vetor [j] > vetor [indiceMaior]) (indiceMaior = j;}

Link permanente: /questoes/fc070432