-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Min and Max PriorityQueue #129
base: master
Are you sure you want to change the base?
Conversation
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).
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? |
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.
@felipernb Any updates on this, Sir? |
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).