* docs: expand bubble sort docstrings with algorithm explanation
Add a concise description of how bubble sort works (repeated
adjacent comparisons/swaps until a pass makes no swaps) and note
time/space complexity for both the iterative and recursive
implementations. No behavior changes; all existing doctests pass.
* Fix Ruff 0.16 lint failures
* S310
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Fixed bug in bubble_sort_recursive docstring where the doctest was calling bubble_sort_iterative([]) instead of bubble_sort_recursive([]). This was a copy-paste error that would cause the doctest to pass even if bubble_sort_recursive had issues with empty lists.
Change:
- Line 71: Changed '>>> bubble_sort_iterative([])' to '>>> bubble_sort_recursive([])'
This ensures the doctest properly validates the recursive implementation.
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Fix return type description in bubble_sort.py
Better (clearer, standard phrasing):
:return: the same collection ordered in ascending order
* Update bubble_sort.py
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* The string manipulation - replace()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update replace.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* updating DIRECTORY.md
* Add doc test to bubble_sort
* Update DIRECTORY.md
* Delete strings/replace.py
* Update bubble_sort.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: vijayalaxmi777 <vijayalaxmi777@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* For the better understanding of time taken.
In this change I have initialized a variable p with the value of (1e9+7) and then took the modulus of process time with it . This modification gives better time taken by the process . Firstly it was giving answer in the exponential now it gives in the integer form.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>