-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Add skew heap data structure. #3238
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, how would you create a SkewHeap.__len__()
method?
|
Not a fan... Too many places for bugs to pop up. |
Yep, agreed, I always implement the second approach when I need it. |
* Add skew heap data structure. * fixup! Add skew heap data structure. * fixup! Add skew heap data structure. * fixup! Add skew heap data structure. * Add tests. * Add __iter__ method. * fixup! Add __iter__ method.
* Add skew heap data structure. * fixup! Add skew heap data structure. * fixup! Add skew heap data structure. * fixup! Add skew heap data structure. * Add tests. * Add __iter__ method. * fixup! Add __iter__ method.
Add skew heap data structure.
A data structure that allows inserting a new value and to pop the smallest
values. Both operations take O(logN) time where N is the size of the structure.
Checklist:
Fixes: #{$ISSUE_NO}
.