The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
They probably want you to work out your own algorithm.
You can set a min value which is higher than the minimum, either by using numbers or Integer.MAX_VALUE. Then you iterate the array; if the value you find is smaller than the min value, use that as the new min value. You can also record the index in another variable if you wish. When you get to the end of the array . . . voila!
If you read that book I mentioned you'll understand, but recursion is the basics: min(a, a, a, ..., a[n]) == min(min(a, a, a, ..., a[n - 1]), a[n])
Somewhere this has to end, and Dijkstra and his followers have chosen not to use just an array of size 1 but an empty array as the basis. Basically, they have given undefined a value. And until you have a special symbol for undefined, that makes sense. If the end result of a non-empty array is that value you know that ALL values of the array have that value.
And it's +∞ that is the minimum over an empty list. -∞ would cause problems since -∞ < x for all x. [ October 28, 2008: Message edited by: Rob Prime ]