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

learn more… | top users | synonyms

0
votes
0answers
32 views

Priority Queue/BinaryHeap Implementation in Objective-C

I don't see a ready-made priority queue class in Objective-C. Please review this. Full xcodeproject with unit test cases at https://github.com/smartiothome/BinaryHeap Heap.h ...
4
votes
0answers
94 views

Indexed Fibonacci heap implementation

I implemented two versions of a Fibonacci heap one using a unordered map (mapping keys to their nodes) so that the client can call decrease in \$O(1)\$ average and ...
1
vote
1answer
101 views

Implement a generic Priority Queue in C++

I wrote a Priority Queue that is stored using a doubly linked list. The queue can return the head and tail of the list, and contains a print function that is only used for testing purposes. I'd like ...
4
votes
3answers
57 views

C Threadsafe Priority Queue O(log n) push, O(1) pop

I wrote this for an A* implementation: (pqueue.c) ...
1
vote
0answers
37 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 ...
10
votes
1answer
70 views

Longest lines using priority queue

Inspired by a comment on this question, I thought I'd exercise my C skills by implementing something like it using a priority queue. The idea is to be able to invoke the program like this: ./...
4
votes
4answers
149 views

Subdividing intervals that contain the largest error values

I'm trying to accomplish the following: Start out with 1 interval on the real line. This interval is processed in some function and out comes an array of errors (size < 10 usually). The maximum ...
3
votes
2answers
43 views

Time Limit Exceeded for build_max_heap

This problem is from HackerEarth: The Monk learned about priority queues recently and asked his teacher for an interesting problem. So his teacher came up with a simple problem. He now has an ...
1
vote
3answers
285 views

Priority Queue (Binary Search Tree) Implementation

I have made a Priority Queue implemented as a Binary Search Tree. I would appreciate comments related to optimization and proper functionality, but any comments/critiques are welcome. PQ.h: ...
1
vote
0answers
46 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....
1
vote
2answers
119 views

Fibonacci heap in C - follow-up

(See the previous iteration.) I have incorporated some points made by ChrisWue and refactored my Fibonacci heap implementation: fibonacci_heap.h ...
3
votes
1answer
290 views

Fibonacci heap in C

(See the next iteration.) I have rewritten a Fibonacci heap implementation from Java to C. fibonacci_heap.h: ...
10
votes
2answers
156 views

SortedStack implementation in Java

This is a data structure that supports the push(), pop() and isEmpty() operations and ...
3
votes
0answers
64 views

Updatable priority queue

This is an updatable priority queue. In contains an index (implemented as std::unordered_map) which maps a value to its position in the queue itself. The queue is ...
3
votes
0answers
74 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 ...
5
votes
1answer
91 views

Comparing puzzle solvers in Java

I have this program that solves a \$(n^2 - 1)\$-puzzles for general \$n\$. I have three solvers: BidirectionalBFSPathFinder ...
3
votes
1answer
62 views

d-ary heap in C

Now I have this d-ary heap data structure. Note that for d = 2 this is a binary heap. The client programmer specifies the value ...
4
votes
2answers
360 views

ObservablePriorityQueue<T> Implementation

I have a requirement in my current project that will need a Prioritised Queue that supports the IObservable interface. Please notify me of any problems with the implementation that I currently have: ...
5
votes
1answer
3k views

Javascript PriorityQueue based on object property

I wrote this class which is a priority queue based on a numeric property of any object. As far as I can tell, the following code is working as intended. Are there any stylistic tendencies that I am ...
6
votes
2answers
902 views

My implementation of FixedSizedPriorityQueue

I implemented a fixed sized priority queue. How can I improve my code? ...
3
votes
4answers
5k views

Priority queue implementation in C#

My application has a thread for handling database inserts and updates. Data is added by other threads to a generic queue in the DB thread. The contents of this queue is retrieved and is sequentially ...