Ahh, today I learned. Makes sense if you don’t need have the heap already to not construct a full one but just use a small heap for quickly maintaining a set of the k-top ones seen this far and deciding if the next is included.
Interestingly it’s something I actually thought about the other day (finding k-max in a sequence without comparing to the whole list) without realizing this solution for (which a heap is of course really ideal for).