Skip to content

Conversation

@kl2400033266
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants