I need it for an implementation of Dijkstra's algorithm, and I do have my own implementation but documenting my code would be easier with java's own classes.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No, Java standard library has no such data structure. I think most people use this: http://algs4.cs.princeton.edu/24pq/IndexMinPQ.java.html
回答2:
What do you mean 'indexed'? Priority queue doesn't support indexing, unless it won't be queue any more.
Java supports standard Priority Queue like C++ STL. It can be found in java.util namespace as PriorityQueue.