Questions tagged [priority-queue]

Priority queues are dynamic sets that always remove highest priority elements first.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
1k views

Fibonacci heap in Python

I have this implementation of the Fibonacci heap in Python: ...
2
votes
0answers
102 views

An ISeq implementing Priority Queue

This is a follow up to my last review request. I made three major changes: I had it fully implement ISeq and IPersistentStack, ...
2
votes
0answers
74 views

A Priority Queue implemented using a Linked List

I'm going to write a Huffman Coding implementation, and decided to write from scratch a priority queue to help out. I've never written a priority queue before, in any language, so this was interesting....
2
votes
0answers
887 views

Priority queue with updatable values

I'm writing a priority queue that stores a bunch of data with a value attached to the data, with \$O(1)\$ access to the data with the smallest value attached to it. I also need to be able to update ...
2
votes
0answers
466 views

Min-Heap based priority queue class written in ES6

I would appreciate any feedback on syntax, naming convention, possible shortcuts, clarity of code and any other constructive feedback. This code was based off of the Priority Queue chapter in The ...
1
vote
0answers
28 views

Making a priority queue using a Heap. Without using queue or heapq

I have to implement a priority queue using a heap without any library / package for priority queue or heap. I made a BinHeap class which is a min heap, and I made a priority queue class with enqueque, ...
1
vote
0answers
96 views

Sorted set a Queue

I needed a data structure offering both poll returning the smallest element and fast contains. A ...
1
vote
0answers
397 views

Efficient stable priority queue in Java

I have this stable priority queue. It runs all the operations within \$\mathcal{O}(\log P)\$, where \$P\$ is the number of distinct priority keys (which may be smaller than the number of elements ...
1
vote
0answers
96 views

Purely functional octree and octree priority queue

I'm programming a game in Scala, and a lot of tasks are able to be done in the background. I've created a system in which each Future can be assigned a position in 3d space, and they are stored in an ...
1
vote
0answers
570 views

Minimum Priority Queue using Heap

After getting suggestions for Maximum Priority Queue I have written program for Minimum Priority Queue. Help me improve this code. ...
1
vote
0answers
52 views

Glueing Java collections into a heap

I have implemented this heap (priority queue) data structure using java.util.TreeMap and java.util.ArrayDeque. The operations ...
1
vote
0answers
104 views

Generic implementation of mutable binary heap

std::priority_queue does not support dynamically updating element priorities. This class template extends it by allowing updating priorities of elements in the heap....