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.

C++ priority_queue with lambda comparator error

I have the following erroneous code which I am trying to compile in VC2010, but I'm getting the error C2974 …

c++ stl lambda c++11 priority-queue
STL Priority Queue on custom class

I'm having a lot of trouble getting my priority queue to recognize which parameter it should sort by. I've overloaded …

c++ stl priority-queue comparator
How to do an efficient priority update in STL priority_queue?

I have a priority_queue of some object: typedef priority_queue<Object> Queue; Queue queue; From time to …

c++ stl priority-queue
Priority queue for user-defined types

I have the below struct struct node{ float val; int count; } I have several objects of this struct. Now, I …

c++ priority-queue min-heap
Efficiency of the STL priority_queue

I have an application (C++) that I think would be well served by an STL priority_queue. The documentation says: …

c++ data-structures stl performance priority-queue
Changing Java PriorityQueue to a Max PQ

The Priority Queue implementation in the Java standard library appears to be a min Priority Queue which I found somewhat …

java priority-queue standard-library
Difference between priority queue and a heap

It seems that a priority queue is just a heap with normal queue operations like insert, delete, top, etc. Is …

c++ algorithm heap priority-queue
What's faster: inserting into a priority queue, or sorting retrospectively?

What's faster: inserting into a priority queue, or sorting retrospectively? I am generating some items that I need to be …

c++ sorting complexity-theory priority-queue
Java Priority Queue reordering when editing elements

I'm trying to implement Dijkstra's algorithm for finding shortest paths using a priority queue. In each step of the algorithm, …

java priority-queue
Add Key and Value into an Priority Queue and Sort by Key in Java

I am trying to take in a List of strings and add them into a Priority Queue with Key and …

java priority-queue