Skip to content

Adding stooge sort - #1206

Merged
cclauss merged 3 commits into
TheAlgorithms:masterfrom
Charitoc:master
Sep 26, 2019
Merged

Adding stooge sort#1206
cclauss merged 3 commits into
TheAlgorithms:masterfrom
Charitoc:master

Conversation

@Charitoc

Copy link
Copy Markdown
Contributor

No description provided.

@CharitocCharitoc reopened this Sep 26, 2019
@cclauss

Copy link
Copy Markdown
Member

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

Comment threadsorts/stooge_sort.py Outdated
@cclauss

Copy link
Copy Markdown
Member

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

@Charitoc

Copy link
Copy Markdown
ContributorAuthor

It is ready, could you do the review?

@cclausscclauss left a comment

Copy link
Copy Markdown
Member

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:masterSep 26, 2019
@Charitoc

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@cclauss

cclauss commented Sep 26, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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 freeto 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

@Charitoc@cclauss