📜  优先级队列与设置 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:53.432000             🧑  作者: Mango

代码示例1
A priority queue only gives you access to one element in sorted order --
i.e., you can get the highest priority item, and when you remove that,
you can get the next highest priority, and so on.
A priority queue also allows duplicate elements, so it's more like a
multiset than a set. 

A set allows you full access in sorted order, so you can, for example,
find two elements somewhere in the middle of the set, then traverse in
order from one to the other.