Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min and Max PriorityQueue #129

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Min and Max PriorityQueue #129

wants to merge 6 commits into from

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.

None yet

3 participants