Priority queues are dynamic sets that always remove highest priority elements first.
0
votes
0answers
14 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 ...
8
votes
1answer
56 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
144 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
34 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
189 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
44 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 ...
1
vote
2answers
94 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
188 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
147 views
SortedStack implementation in Java
This is a data structure that supports the push(), pop() and isEmpty() operations and ...
3
votes
0answers
53 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
46 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
84 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
57 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
336 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
855 views
My implementation of FixedSizedPriorityQueue
I implemented a fixed sized priority queue.
How can I improve my code?
...