Search code examples
javaperformancedata-structuresqueuepriority-queue

How is the java.util.priorityqueue implemented?


Does anyone know the implementation details for the standard java priority queue? heap? skiplist?


Solution

  • Javadoc says it's a heap: http://download.oracle.com/javase/6/docs/api/java/util/PriorityQueue.html

    First sentence, first paragraph:

    An unbounded priority queue based on a priority heap.