aklepatc ([personal profile] aklepatc) wrote 2024-05-08 08:05 pm (UTC)

Well, priority queue is rather an interface than a particular data structure.

When ppl say "priority queue" they typically mean "min-max heap". If your guess is the same then it is not the best guess. Min heap gives you O(log(N)) time for push/pop. And this problem has a O(1) (or very close to that) solution.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting