Question d’entretien chez Amazon

Given an array, return the nth largest.

Réponses aux questions d'entretien

Utilisateur anonyme

15 janv. 2013

No sorting...it would take nlgn for sorting and it could be faster..

1

Utilisateur anonyme

17 févr. 2013

http://en.wikipedia.org/wiki/Selection_algorithm

1

Utilisateur anonyme

25 oct. 2012

Can be in any language. I did write the working code, but the interviewer pointed out that it won't work for some special cases.

Utilisateur anonyme

15 janv. 2013

public static void sortArray(int n){ Integer[] arrayList = {12,2,5,1,7,8,3,4,9,10,13,11,6}; Arrays.sort(arrayList); System.out.println("for number : " + (n + 1) + " we get: " + arrayList[n]); }