Does java have a minimum priority queue?

I need this to implement Dijkstra's algorithm, and I have my own implementation, but documenting my code would be easier with Java classes.

+7
source share
2 answers

What does indexing mean? The priority queue does not support indexing if it is no longer in the queue.

Java supports a standard priority queue such as C ++ STL. It can be found in the java.util namespace as PriorityQueue .

+2
source

No, the standard Java library does not have such a data structure. I think most people use this: http://algs4.cs.princeton.edu/24pq/IndexMinPQ.java.html

+2
source

All Articles