Top "Priority-queue" questions

A priority queue is a regular queue or stack data structure, but where additionally each element has a "priority" associated with it.

Creating Min Heap from STL Priority Queue

I am creating a min heap from stl priority queue. Here is my class which I am using. class Plane { …

c++ priority-queue min-heap
Dijkstra algorithm. Min heap as a min-priority queue

I'm reading about Dijkstra's algorithm in CLRS, Third Edition (p. 662). Here is a part from the book I don't understand: …

heap priority-queue dijkstra min-heap
Priority Queue with a find function - Fastest Implementation

I am looking at implementing a priority queue with an added requirement, a find/search function which will tell whether …

optimization types heap binary-tree priority-queue
Please explain the relation between Decrease-Key and Extract-Min operations in priority queues

What is the relation between EXTRACT-MIN operation and DECREASE-KEY operations in priority queue? I encountered this in the lecture for …

algorithm data-structures priority-queue minimum-spanning-tree prims-algorithm
Is there a maxheap in the C++ standard library?

I know the std::priority_queue class implements a minheap. Is there a way to use this as a Max …

c++ priority-queue c++-standard-library standard-library max-heap
How can I make a unique value priority queue in Python?

Python has Queue.PriorityQueue, but I cannot see a way to make each value in it unique as there is …

python priority-queue
C++ priority_queue underlying vector container capacity resize

I'm using priority_queue with a vector as an underlying container. However I expect the size of the heap to …

c++ priority-queue
Java: Access local variables from anon inner class? (PriorityQueue)

I want to use a PriorityQueue to do a topological sort on a graph. For brevity, I'd like to use …

java graph priority-queue anonymous-class topological-sort