notes on extremes
From ggc
set extreme to first value
go through the remaining values and if value
excede then replace the extreme with that value
code:
int min=nums[0];
System.out.println("Starting minimum: "+min);
for(int i=1; i<nums.length; i++) {
if(nums[i]<min)
{
System.out.println("Minimum is now "+min);
min=nums[i];
}
System.out.println("Finally, the minimum is "+min);
}
- This page was last modified on 3 April 2008, at 12:24.
- This page has been accessed 262 times.
- Privacy policy
- About ggc
- Disclaimers
- Powered by MediaWiki!









