Create slowsort.py by DjaouadNM · Pull Request #3865 · TheAlgorithms/Python · GitHub
Skip to content

Create slowsort.py - #3865

Merged
cclauss merged 13 commits into
TheAlgorithms:masterfrom
DjaouadNM:patch-2
Feb 9, 2021
Merged

cclauss merged 13 commits into
TheAlgorithms:masterfrom
DjaouadNM:patch-2

Conversation

@DjaouadNM

@DjaouadNM DjaouadNM commented Nov 5, 2020

Copy link
Copy Markdown
Contributor

added slowsort algorithm implementation to sorts

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

added slowsort algorithm implementation to sorts
@DjaouadNM
DjaouadNM requested a review from l3str4nge as a code owner November 5, 2020 18:28
@mrmaxguns

Copy link
Copy Markdown
Member

@DjaouadNM

Copy link
Copy Markdown
Contributor Author

The algorithm you linked to is Bogosort, which is an entirely different algorithm, but it is also called Slowsort at times.

@mrmaxguns

Copy link
Copy Markdown
Member

Oh, ok. Sorry for the misunderstanding

@DjaouadNM

DjaouadNM commented Nov 5, 2020

Copy link
Copy Markdown
Contributor Author

No worries, you could look at the code and notice the differences, you could also check Bogosort and Slowsort at Wikipedia.

Comment thread sorts/slowsort.py Outdated
@mrmaxguns

Copy link
Copy Markdown
Member

Isort failed, looks like you need to reorder the imports

@DjaouadNM

Copy link
Copy Markdown
Contributor Author

Done!

@mrmaxguns

Copy link
Copy Markdown
Member

Thanks for contributing to open source 👍

@cclauss could you review and merge this pull request?

Comment thread sorts/slowsort.py Outdated
@ghost ghost deleted a comment from cclauss Dec 2, 2020
@dhruvmanila

Copy link
Copy Markdown
Member

@algorithms-keeper review

@ghost ghost added the require descriptive names This PR needs descriptive function and/or variable names label Dec 11, 2020

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will only modify the labels accordingly.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread sorts/slowsort.py Outdated
from typing import Optional


def slowsort(sequence: list, i: Optional[int] = None, j: Optional[int] = None) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide descriptive name for the parameter: i

Please provide descriptive name for the parameter: j

@ghost ghost added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass and removed require descriptive names This PR needs descriptive function and/or variable names awaiting reviews This PR is ready to be reviewed labels Dec 11, 2020
@ghost ghost added awaiting reviews This PR is ready to be reviewed and removed tests are failing Do not merge until tests pass labels Dec 11, 2020
@stale

stale Bot commented Jan 11, 2021

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added stale Used to mark an issue or pull request stale. and removed stale Used to mark an issue or pull request stale. labels Jan 11, 2021
@mrmaxguns

Copy link
Copy Markdown
Member

A maintainer should probably merge this PR unless there's an issue; we don't want valid pull requests to be closed as stale 😞

@cclauss

cclauss commented Feb 5, 2021

Copy link
Copy Markdown
Member

@mrmaxguns If you believe that this PR is ready to be landed, please click the Review changes button at https://github.com/TheAlgorithms/Python/pull/3865/files and Approve.

@mrmaxguns mrmaxguns 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.

This pull request is good to good to go:

  • Unique
  • Docstrings
  • Type hints
  • Readability
  • Doctests

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to go, although i would like to ask if it is prone to recursion error

@cclauss

cclauss commented Feb 9, 2021

Copy link
Copy Markdown
Member

@mateuszz0000 Is this ready to land?

@DjaouadNM

Copy link
Copy Markdown
Contributor Author

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

I am not a fan of purposefully inefficient algorithms of little utility (esp. sleep_sort!) -- perhaps the humourous nature is beyond my comprehension. Heating the planet with inefficient algorithms is what TheAlgorithms are trying to avoid. But this one has been batted about long enough so let's land it...

Comment thread sorts/slowsort.py
@cclauss
cclauss merged commit 4903a65 into TheAlgorithms:master Feb 9, 2021
@ghost ghost removed awaiting reviews This PR is ready to be reviewed labels Feb 9, 2021
peRFectBeliever pushed a commit to peRFectBeliever/Python that referenced this pull request Apr 1, 2021
* Create slowsort.py

added slowsort algorithm implementation to sorts

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Create slowsort.py

added slowsort algorithm implementation to sorts

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
* Create slowsort.py

added slowsort algorithm implementation to sorts

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py

* Update slowsort.py
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.

5 participants