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.

A priority queue which allows efficient priority update?

UPDATE: Here's my implementation of Hashed Timing Wheels. Please let me know if you have an idea to improve the …

data-structures timeout queue scheduling priority-queue
How to tell a std::priority_queue to refresh its ordering?

I have a priority queue of pointers to a struct city. I modify the objects pointed by these pointers outside …

c++ stl priority-queue
C++ STL : Using map with priority_queue

I'm trying to implement Huffman coding by saving letters and their corresponding values into a map then inserting the map …

c++ stl map priority-queue huffman-code
How to create a PriorityQueue with new comparator and NO specified initial capacity?

in Java, I don't know how to create a new PriorityQueue with new comparator but without given the queue length? …

java priority-queue
Priority queue with higher priority first in Python

I need a priority queue that gets the item with the highest priority value first. I'm currently using the PriorityQueue …

python queue priority-queue
Python: Update value of element in heapq

If I have a heapq which contains some elements like: import heapq class Element(object): def __init__(self, name, val): …

python python-2.7 queue heap priority-queue
When should I use make_heap vs. Priority Queue?

I have a vector that I want to use to create a heap. I'm not sure if I should use …

c++ heap priority-queue
Bounded PriorityBlockingQueue

PriorityBlockingQueue is unbounded, but I need to bound it somehow. What is the best way to achieve that? For information, …

java collections priority-queue
Efficient implementation of binary heaps

I'm looking for information on how to implement binary heaps efficiently. I feel like there should be a nice article …

c++ data-structures performance computer-science priority-queue