Pergunta de entrevista da empresa Bloomberg

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

Resposta da entrevista

Sigiloso

13 de nov. de 2018

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