Skip to content

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

Merged

Conversation

KirilBangachev
Copy link
Contributor

Implementing the binomial heap data structure.
Reference: Advanced Data Structures, Peter Brass

Implementation of Binomial Heap. Reference: Advanced Data Structures, Peter Brass
- Fuller documentation of binomial heap
- Update unit tests
- Replace printing method by overwriting __str__()
@KirilBangachev KirilBangachev changed the title Binomial Heap Add Binomial Heap Sep 3, 2019
Copy link
Member

@cclauss cclauss left a 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
@cclauss
Copy link
Member

cclauss commented Sep 4, 2019

Looks good to me but still needs to appear in our tests
https://travis-ci.org/TheAlgorithms/Python/builds/580553572#L618

@KirilBangachev
Copy link
Contributor Author

Looks good to me but still needs to appear in our tests
https://travis-ci.org/TheAlgorithms/Python/builds/580553572#L618

Would it help if I add some doctests in addition to the unit tests?

@cclauss
Copy link
Member

cclauss commented Sep 4, 2019

Or get the unittests to be recognized by pytest.

Copy link
Member

@cclauss cclauss left a 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.

@cclauss cclauss merged commit f31a812 into TheAlgorithms:master Sep 5, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* 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
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.

2 participants