go to previous page   go to home page   go to next page

Answer:

array     = new int[ size ];  

Minimum and Maximum

The largest integer in a list of integers is the maximum value. The maximum may occur several times, but no other integer in the list is larger. Look at the following:

2, 9, 52, 23, -19, 23, 17, -45, 0

The integer 52 is the maximum. If you plot these integers on a number line 52 is the last one on the right:

number line

Similarly, the smallest integer in the list is the minimum. The minimum may occur several times. In the above list, the minimum is -45. The minimum is the last number on the left of the number line.

QUESTION 7:

Examine the following collection of integers:

-20, 19, 1, 27, 5, -1, 27, 19, 5
  1. What is the maximum of the collection?
  2. How did you figure this out?