Question d’entretien chez Amazon

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

Réponse à la question d'entretien

Utilisateur anonyme

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.