2 ms·
That sounds about right. Initializing the variables to the first two elements in the array is something very few people think to do. Most people set them to 0
by tempestn 12y ago
That sounds about right. Initializing the variables to the first two elements in the array is something very few people think to do. Most people set them to 0, which obviously doesn't work if the array doesn't contain at least two positive values. Of course, Blackthorn is also right that it's language-dependent. Most languages give you negative infinity, or treat null or false as negative infinity in comparisons, which makes things simpler.