Questions tagged [priority-queue]
Priority queues are dynamic sets that always remove highest priority elements first.
72
questions
5
votes
0
answers
95
views
Dial's heap in Java for integer priority queues
(The entire project is here.)
Intro
I have this priority queue data structure for non-negative integer priority keys. I recall that it is called Dial's heap.
Code
Implementation
...
3
votes
1
answer
133
views
Binary heap based priority queue implementation in C#
I made this Priority Queue implementation for C# since it doesn't support updating priorities in logarithmic time complexity. I did some tests and it seems that it's correct. However, I'm not sure ...
7
votes
2
answers
389
views
Priority Queue (With raise priority operation) using Vector
Here I have implemented a priority queue, with the addition of the raise_priority (also known as reduce key) operation. The reason I have effectively reimplemented std::priority_queue is because the ...
1
vote
0
answers
165
views
Priority Queue implementation using a Heap [closed]
I'm working on a custom implementation of A-Star and so I had to also create a Priority Queue and so I had to create a Heap. I'm quite happy with my Heap but I'm a bit worried about my Priority Queue: ...
5
votes
1
answer
84
views
Bidirectional Dijkstra d-ary heap
This is my very first data structure written in Perl for a d-ary heap:
...
2
votes
1
answer
108
views
Priority Queue for D* Lite
So, I needed a priority queue for D* lite and I wanted to know whether this is an acceptable implementation or not.
...
6
votes
2
answers
3k
views
C++ Thread safe priority queue implementation
My first attempt at writing a thread safe priority_queue. It is not the most efficient because the locks can be even more fine grained if I add implementation of heap instead of using priority_queue ...
2
votes
0
answers
295
views
Kotlin AsyncPriorityQueue
Unbounded threadsafe suspending priority queue
Items are ordered by an integer priority value passed into the enqueue() method
dequeue() retrieves and removes the head of the queue or suspends until ...
2
votes
1
answer
250
views
Minimum Spanning Tree in Rust
As a project I have worked on implementing and benchmarking two different minimum spanning tree algorithms in rust. My main concern is adhering to good style and not programming any glaring ...
0
votes
1
answer
71
views
Assigning Tasks to Entities (or some other entity) based on Priority
Main Questions:
Is my runtime analysis correct?
Is my approach optimal or close to it?
Is there a better way and/or improvements?
Objective:
Write an algorithm to assign ...
2
votes
1
answer
926
views
Generic PriorityQueue (Min-Heap) implementation
I was trying to implement a generic PriorityQueue in C#. Below is my implementation which works fine as per few test cases.
Operations supported-
Add: Adds an element
Poll: Removes the smallest ...
8
votes
2
answers
520
views
Planned Economy Bakery - Trying to scale a nested loop with a heap
Let's say you are living in a controlled economy where there is a baker in town, and every day he bakes a random number of loaves of bread (sometimes the oven breaks, or he has less ingredients). The ...
2
votes
2
answers
532
views
Priority queue implementation on C. (For Huffman Coding)
I trying to implement Huffman Codes on C. And, since my previous attempt failed, I decided to approach the issue more responsibly. So I'm asking for feedback on my implementation of the priority queue ...
4
votes
2
answers
191
views
JavaScript Priority Queue implementation using a binary heap
I'm currently going over Robert Sedgewick's Algorithms book. For the implementation of A priority queue using a binary heap I implemented the code using ES6. I believe to have more experience with ...
1
vote
0
answers
130
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, ...