16/30
Part 4 of 7 · Why not a heapWatch
Watch · 2 min
A max heap from 11:21, then tuples on a heap from 11:55, with the priority first so the heap orders by it. Python's heapq only pops the smallest, which is why this part's keys start with the negated score.
Heaps & Priority Queues - Heapify, Heap Sort, Heapq Library - DSA Course in Python Lecture 9 · Greg Hogg · Jul 2024YouTube