0

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?

user3435407
  • 1,019
  • 4
  • 15
  • 31

1 Answers1

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