function top_k(items, k):
   heap = build_min_heap(items[:k])

   for value in items[k:]:
      if value > heap.peek_min():
        heap.pop_min()
        heap.push(value)
   return heap.contents  # O(n log k), not O(n log n)
