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

Priority queue documentation has wrong complexities #3

Open
jsonn opened this issue Feb 5, 2015 · 0 comments
Open

Priority queue documentation has wrong complexities #3

jsonn opened this issue Feb 5, 2015 · 0 comments

Comments

@jsonn
Copy link

jsonn commented Feb 5, 2015

The complexity of a pairing heap is stated incorrectly. Amortised and actual complexity of push() should be $O(1)$. Amortised complexity of erase() and pop() should be $log(n)$.

The implementation of the decrease() part of update() would normally be $2**(2sqrt(log(log(n)))$. I don't think the current implementation provides that as the check for empty children list is not conditional on the direction of cost change. As such, update() seems to be unconditionally $log(n)$ amortised, just like an increase() would be. Merge should be $O(1)$ as usual.

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

No branches or pull requests

1 participant