Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: add time and space complexity to selection_sort docstring #13972

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

Open
kl2400033266 wants to merge 1 commit into TheAlgorithms:master
base: master
Choose a base branch
Loading
from kl2400033266:docs/add-complexity-selection-sort

Conversation

@kl2400033266
Copy link

@kl2400033266 kl2400033266 commented Nov 27, 2025

Added Time Complexity O(n^2) and Space Complexity O(1) documentation to the selection_sort function docstring, improving code documentation for beginners as requested in issue #13948.

Describe your change:

This PR adds time and space complexity information to the selection_sort function docstring in sorts/selection_sort.py. The documentation now includes:

  • Time Complexity: O(n^2) - with explanation of the nested loops
  • Space Complexity: O(1) - noting that only constant extra space is used
  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests?
  • 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.

Related to issue #13948

Added Time Complexity O(n^2) and Space Complexity O(1) documentation to the selection_sort function docstring, improving code documentation for beginners as requested in issue TheAlgorithms#13948.
Copy link
Author

Hi @vishalbeniwal @mcoding 👋
Just checking in to see if this PR is ready for review.
All checks have passed, and the documentation updates for selection_sort are complete.
Whenever you have a moment, I would appreciate an approval so it can be merged.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@mindaugl mindaugl mindaugl approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /