Domanda di colloquio di Bloomberg

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

Risposta di colloquio

Anonimo

13 nov 2018

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