-
-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
Consolidate bubble sort iterative and recursive #10651
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.
- Fix function signature to be similar.
- Add a
timeit
benchmark to prove the relative performance.
- https://docs.python.org/3/library/timeit.html
- https://github.com/search?q=repo%3ATheAlgorithms%2FPython%20timeit
- Doctests should cover similar (or identical) test cases across both functions.
Co-authored-by: Christian Clauss <cclauss@me.com>
Hi @cclauss to my understanding, the requested changes have been completed. Let me know what you think, please |
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.
Let's bubble!!! Thanks for doing this.
Final edits: b37d3bb
* Consolidate bubble sort iterative and recursive * Update sorts/bubble_sort.py Co-authored-by: Christian Clauss <cclauss@me.com> * Refactor bubble sort func signature, doctest, timer * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bubble_sort.py --------- Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Describe your change:
Ref #8098
Merge
recursive_bubble_sort
withbubble_sort
, renaming functions tobubble_sort_recursive
andbubble_sort_iterative
, respectively.Checklist: