Find the second largest element in an array?
Anónimo
Keep largest and secondLargest iterate over the array and whenever you find an element greater than largest update secondLargest to largest and largest to current element or if the element is smaller than largest but greater than secondLargest simply update secondLargest to current element.