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.

How to implement PriorityBlockingQueue with ThreadPoolExecutor and custom tasks

I've searched a lot but could not find a solutuion to my problem. I have my own class, BaseTask, that …

java threadpool priority-queue executor futuretask
Java priority queues and comparable interface

I've just been learning about priority queues and thought I'd try how it behaves with comparable interface. Code Snippet: import …

java priority-queue comparable
When would I use a priority queue?

The only example of using the priority queue I know of, is the Dijkstra's Algorithm (for calculating minimum cost) In …

algorithm queue priority-queue
Java - PriorityQueue vs sorted LinkedList

Which implementation is less "heavy": PriorityQueue or a sorted LinkedList (using a Comparator)? I want to have all the items …

java sorting linked-list priority-queue
When should I use a TreeMap over a PriorityQueue and vice versa?

Seems they both let you retrieve the minimum, which is what I need for Prim's algorithm, and force me to …

java priority-queue treemap
Is using std::deque or std::priority_queue thread-safe?

Possible Duplicates: Is the C++ STL std::set thread-safe? Thread safety for STL queue I'm guessing it isn't, I just …

c++ stl thread-safety priority-queue deque
PriorityQueue not sorting on add

I have a Priority Queue in which I add a Node object to, where the Nodes should be sorted by …

java sorting priority-queue
Priority queue of pairs in reverse order

I'm wanting to do something like this: priority_queue< pair<int, int>, vector<int>, greater&…

c++ priority-queue
How to compare generic nodes in a linked list using Comparable?

I am implementing a sorted list using linked lists. My node class looks like this public class Node<E&…

java generics priority-queue sortedlist
What is the difference between binary heaps and binomial heaps?

I need to know the main difference between binary and binomial heaps regardless of the their structure difference that binary …

algorithm data-structures priority-queue binary-heap binomial-heap