-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Added strand sort #1981
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
Added strand sort #1981
Conversation
Co-Authored-By: Christian Clauss <[email protected]>
Co-Authored-By: Christian Clauss <[email protected]>
Co-Authored-By: Christian Clauss <[email protected]>
23 commits o.O I will reopen this PR. |
import operator | ||
|
||
|
||
def strand_sort(arr: list, solution: list, _operator: callable): |
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.
This sort would be easier to use (and test) if it returned a list instead of requiring the caller to allocate and pass in a solution
list.
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.
It would also be cool if _operator
was an optional parameter with the default set to operator.gt
.
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.
Describe your change:
I didn't find strand sort (https://en.wikipedia.org/wiki/Strand_sort) implemenation so here it is.
Checklist:
Fixes: #{$ISSUE_NO}
.