Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 12, 2018

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).

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).
@felipernb
Copy link
Owner

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?

@ghost
Copy link
Author

ghost commented Aug 15, 2018

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.

fixed some variable naming in comments. 
In extract(), now the removed element will be deleted from indexLookup and not set to null.
@coveralls
Copy link

Coverage Status

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

@ghost
Copy link
Author

ghost commented Oct 7, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants