I don't understand python's heapq module. You can push and pop, but it doesn't return an actual heap object ... So I ask myself, does it recreate the tree every single time I push on it? Why is it not giving a heap object? Do you know an alternative to heapq?
Asked
Active
Viewed 43 times
1 Answers
0
Ok I found that you can do this with: queue.PriorityQueue A bit counter intuitive naming, when you search for heap...

user3435407
- 1,019
- 4
- 15
- 31
-
No, that isn't how you use `heapq` – juanpa.arrivillaga Nov 10 '19 at 01:16