Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果 中有多个具有相同值的元素,PriorityQueue则从队列中删除哪个元素被弹出?弹出这些相同元素是否有任何特定顺序?
PriorityQueue
没有具体的顺序。Javadoc 指定:
如果多个元素以最低值绑定,则头部是这些元素之一——绑定被任意打破。