Skip to content

Adding stooge sort #1206

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
merged 3 commits into from
Sep 26, 2019
Merged

Adding stooge sort #1206

merged 3 commits into from
Sep 26, 2019

Conversation

Charitoc
Copy link
Contributor

No description provided.

@Charitoc Charitoc closed this Sep 26, 2019
@Charitoc Charitoc reopened this Sep 26, 2019
@cclauss
Copy link
Member

cclauss commented Sep 26, 2019

The failing Travis CI builds are not caused by this PR but are instead caused by my mistake in #1205.

@cclauss
Copy link
Member

cclauss commented Sep 26, 2019

While waiting, you should be able to test this locally with python3 -m doctest -v sorts/stooge_sort.py

@Charitoc
Copy link
Contributor Author

It is ready, could you do the review?

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.

Awesome work! Thanks for your patience with the broken build and thanks for your contribution.

@cclauss cclauss merged commit 2375bfb into TheAlgorithms:master Sep 26, 2019
@Charitoc
Copy link
Contributor Author

Thank you!

@cclauss
Copy link
Member

cclauss commented Sep 26, 2019

On thing to think about in the future is the difference between list.sort() and sorted(list) in Python. The first is an in-place sort (like this stooge_sort()) while the second returns a new sorted list without modifying the original list. Both are useful but I tend to like the second better.

https://docs.python.org/3/howto/sorting.html

@Charitoc
Copy link
Contributor Author

Ok, thank you for your time.

stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Adding stooge sort

* Updated doctest

* Just added underscore in the name
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