Program FindMax
This program searches for the largest value in an array as follows.
-
At the beginning of the execution, data[0] is copied to tempMax.
-
Then each element in data[] is inspected.
-
The element inspected replaces the current value in tempMax
if it is larger than the one in tempMax.
-
We use currentIdx to designate the element currently being inspected.
Source Code of the FindMax Program
Source Code of the FindMax Program
(Graphical Version)
Back
Home