Pergunta de entrevista da empresa Whatnot

Maintain the k smallest values in an arbitrarily long data stream.

Resposta da entrevista

Sigiloso

2 de nov. de 2022

Use a max-heap to compare the kth largest element with every new element u wish to add to your heap.