Locate a Maximum

The problem: given a list of grades: A1, A2, ..., An, find the largest (or smallest) grade in the list, and give its location in the list.

Informal Algorithm: Scan the list and remember the largest grade found so far in the scan (noting that the first item will automatically be the largest initially).


Find Maximum

Click on START to set up the problem, and then click on STEP to cycle through the successive steps of the locate maximum algorithm.

What is the maximum value in the following list?


CS1104 Main Page
Last Updated 2001/09/11
© L.Heath, 2000, seriously updated by J.A.N. Lee, 2001.