If this is second ( or more ) occurrence , update first and second maximum values .
if ( arr [ i ] > first ) { second = first ; first = arr [ i ] ; } else if ( arr [ i ] > second ) second = arr [ i ] ; }