Computer Science – Algorithm design and problem-solving | e-Consult
Algorithm design and problem-solving (1 questions)
A standard method of solution for finding the largest number in a set involves iterating through the numbers and keeping track of the largest number found so far. Initially, the largest number is assumed to be the first number in the set. Then, for each subsequent number, it is compared to the current largest number. If the current number is larger, it becomes the new largest number.
Pseudocode Example:
START SET largest_number to the first number in the set FOR each number in the set: IF the current number is greater than largest_number: SET largest_number to the current number ENDIF ENDFOR DISPLAY largest_number END
|