Finding 2nd largest number in array (one look at array) : <p>I did a class earlier where we went through this kind of algorithm but can't find my code. How do I find the 2nd biggest number in an array with only 1 scan?</p>

<p>I was thinking about using nodes but that would screw up if the largest and 2nd largest one starts on same side. And an ugly way is to have two extra temp-variables and "find" the smaller one of them. </p>

<p>So anyone got any tip? Oh and it's java if you have the code.
In the meantime I'll try to search more on google!</p>
