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.

Sorting Priority Queue in Java

I was trying to insert the integers in PriorityQueue, and I know that : If no comparator is specified when a …

java priority-queue
How to remove element not at top from priority_queue?

In my program I need to delete an element from a priority queue that is not at the top. Can …

c++ stl priority-queue binary-heap
Pair inside priority queue

I am trying to store pairs in priority queue and I am using a compare function that compares second value …

c++ stl priority-queue std-pair
Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio

I have implemented a compression algorithm (using huffman coding) which uses a priority queue of nodes (a struct i defined). …

c memory-leaks visual-studio-2012 valgrind priority-queue
How to implement O(logn) decrease-key operation for min-heap based Priority Queue?

I am working on an application that demonstrates the Djikstra's algorithm, and to use it, I need to restore the …

algorithm heap priority-queue decrease-key
How to implement Priority Queues in Python?

Sorry for such a silly question but Python docs are confusing.. . Link 1: Queue Implementation http://docs.python.org/library/queue.…

python queue heap priority-queue
Priority Queue Comparison

I'm trying to declare a priority queue in c++ using a custom comparison function... So , I declare the queue as …

c++ priority-queue
Priority Queue remove complexity time

What is the complexity (big-oh) for the remove() function on the Priority Queue class in Java? I can't find anything …

java complexity-theory time-complexity priority-queue
Time complexity of a Priority Queue in C++

Creating a heap takes O(n) time while inserting into a heap (or priority queue) takes O(log(n)) time. …

c++ algorithm big-o priority-queue
Java PriorityQueue with fixed size

I am calculating a large number of possible resulting combinations of an algortihm. To sort this combinations I rate them …

java list size priority-queue