அல்கோரிதம்heap usage

Heap usage

TT
Testlaa Team
May 14, 20261 min read

Top-k, k-way merge, dual heap median.

Try this in Python

import heapq

nums = [3, 1, 4, 1, 5, 9]
print(heapq.nlargest(3, nums))

Key takeaways

  • Streaming size-k heap.
  • Tuple keys.
  • Lazy delete.

Tags:

HeapsPythonமாணவர்கள்