Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

495
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!