in reply to resetting a foreach loop!

Finding the largest and smallest values in an array can be done using a single sequential pass through it, without sorting.