-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Add Binomial Heap #1146
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
Add Binomial Heap #1146
Conversation
Implementation of Binomial Heap. Reference: Advanced Data Structures, Peter Brass
- Fuller documentation of binomial heap - Update unit tests - Replace printing method by overwriting __str__()
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.
Please add doctests and/or type hints.
- Added more tests - Added to the documentation - Stylistic editing - mergeHeaps now also returns a reference to the merged heap - added a preOrder function that returns a list with the preorder of the heap
Looks good to me but still needs to appear in our tests |
Would it help if I add some doctests in addition to the unit tests? |
Or get the unittests to be recognized by pytest. |
Changed the unit tests structure
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.
Nice work! Thanks for your persistence.
* Binomial Heap Implementation of Binomial Heap. Reference: Advanced Data Structures, Peter Brass * Update binomial_heap.py * Update binomial_heap.py * Update binomial_heap.py - Fuller documentation of binomial heap - Update unit tests - Replace printing method by overwriting __str__() * Update binomial_heap.py - Added more tests - Added to the documentation - Stylistic editing - mergeHeaps now also returns a reference to the merged heap - added a preOrder function that returns a list with the preorder of the heap * Update binomial_heap.py Changed the unit tests structure * Turned the tests into doctests
Implementing the binomial heap data structure.
Reference: Advanced Data Structures, Peter Brass