Question d’entretien chez Bloomberg

Print the top 10 largest elements from integer array. Follow up to top K

Réponse à la question d'entretien

Utilisateur anonyme

13 nov. 2018

Make a heap of negative of all the elements. Then heappop() K times. Complexity K*log(n)