Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

502
Visualizações
Pseudocode find biggest number in list

I have come across a question i am trying to answer but cant seems to figure it out, if someone can help me, please.

The intended functionality of the program below is to take a list of more than 1000 numbers (not in sequence) and determine the biggest number in the list. Identify any error(s) within this pseudocode solution and provide an explanation on why you identified this as a potential problem.

Let maxNumber represent the biggest number, set it to zero to start
While there are still numbers left in the list
    Look at the next number in the list
    Compare it to the maxNumber
        If next number is smaller than maxNumber
            Set maxNumber to that number
Report maxNumber as the biggest in the list
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

What if they are all negative numbers. You code will return 0 which is not even in the list. You should set maxNumber to the first number in the list before looping.

about 4 years ago · Juan Pablo Isaza Relatório

0

If you want to find the biggest number, setting maxNumber to the larger numbers is a procedure.

(Still, the question seems too basic.)

Let maxNumber represent the biggest number, set it to zero to start
While there are still numbers left in the list
    Look at the next number in the list
    Compare it to the maxNumber
        If next number is **bigger** than maxNumber
            Set maxNumber to that number
Report maxNumber as the biggest in the list

Else, set maxNumber to the first element in the list for a more precise and valid output.

Let maxNumber represent the first number in the list
While there are still numbers left in the list
    Look at the next number in the list
    Compare it to the maxNumber
        If next number is **bigger** than maxNumber
            Set maxNumber to that number
Report maxNumber as the biggest in the list
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda