Question d’entretien chez Amazon

FInd the kth largest element in an array.

Réponse à la question d'entretien

Utilisateur anonyme

16 mars 2016

Solution 1:- sorting (Merge sort) then print element. complexity: Time O(nlogn) Space: O(n) Solution 2: create a min heap with K size complexity Time O(nlogk) space: O(k)