17/40
Part 4 of 8 · The k bestWatch
Watch · 2 min
Greg Hogg turns heapq's min-heap into a max-heap: negate every value on the way in, and negate the popped value on the way out.
Heaps & Priority Queues - Heapify, Heap Sort, Heapq Library - DSA Course in Python Lecture 9 · Greg Hogg · Jul 2024YouTube