Pregunta de entrevista de Amazon

How would you find the second largest integer in an unsorted array? Write the code.

Respuesta de la entrevista

Anónimo

17 oct 2013

Two possibilities:- 1) Sort the area and find the second largest ( using mergsort, nlogn complexity 2) just transverse the array and keep two temporary variables storing the smallest and second smallest.