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 では次のように指定されています。
複数の要素が最小値で結合されている場合、ヘッドはそれらの要素の 1 つです。結合は任意に解除されます。