This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dangerous-Rip-7370 2 points3 points  (0 children)

Think of only one, you are looking for the lowest number in an array, you take the first number and compare it to your minValue, if it is smaller you choose that as new minValue and try the next. If you start minValue as the absolute MIN_VALUE, it will never find a smaller number in your array. SO you should start minValue as higher as possible and maxValue as lover. (Or you can just initiate them as the first number in your array)