Pergunta de entrevista da empresa Amazon

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

Resposta da entrevista

Sigiloso

17 de out. de 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.