Does java have an indexed minimum priority queue?

后端 未结 2 586
无人共我
无人共我 2021-02-08 10:07

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.

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-08 10:35

    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.

提交回复
热议问题