algorithms.js icon indicating copy to clipboard operation
algorithms.js copied to clipboard

Min and Max PriorityQueue

Open ghost opened this issue 7 years ago • 4 comments

Priority Queue with dynamic change priority. Array and Dictionary data types are used internally. Change Priority function works in amortized constant time, though the change in heap is in O(log n) (The supposed enhancement for previous implementation).

ghost avatar Jul 12 '18 19:07 ghost

Thanks for the PR! There are already implementations for Priority Queues (https://github.com/felipernb/algorithms.js/blob/master/src/data_structures/priority_queue.js) Do you think you could make your changes on top of that instead?

felipernb avatar Jul 15 '18 19:07 felipernb

Since new implementation required changes to be made in almost every method, the code is similar to initial PR but I have updated the method names accordingly to provide the same abstraction.

ghost avatar Aug 15 '18 09:08 ghost

Coverage Status

Coverage increased (+0.2%) to 96.668% when pulling 2bf4a043b97c6a97df5d79500b30a3a73e7fc5d3 on forgotter:priority_queue_patch into 7df9bd1a0a56b8ba0fb1da896537eee589bc2380 on felipernb:master.

coveralls avatar Aug 22 '18 09:08 coveralls

@felipernb Any updates on this, Sir? If there any issue with code, I shall modify it to fix the requirements.

ghost avatar Oct 07 '18 06:10 ghost