* [ADD] tests for odd_even_transposition_parallel
* adding another test because build failed 6 hrs
* comment out all tests to see if it fails
* list(range(10)[::-1]) test uncommented
* [a, x, c] test uncommented
* [1.9, 42.0, 2.8] test uncommented
* [False, True, False] test uncommented
* [1, 32.0, 9] test uncommented
* [1, 32.0, 9] test uncommented
* [-442, -98, -554, 266, -491, 985, -53, -529, 82, -429] test uncommented
* test non global lock
* [DEL] Testing multiple data types. Couldn't get doctest to work
* [ADD] Comment on why non global process lock
* Update cocktail_shaker_sort.py
Added a docstring with clear explanations of the function and its parameters.
Changed variable names i, start, and end for better readability.
Improved comments to describe the purpose of each section of the algorithm.
Adjusted the loop ranges to make the code more concise and readable.
Removed redundant comments and variable assignments.
Provided a clear message when printing the sorted list.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update cocktail_shaker_sort.py
* typing: ignore[operator]
* Update cocktail_shaker_sort.py
* Update cocktail_shaker_sort.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Code Enhancements in merge_sort.py
This enhanced code includes improved variable naming, error handling for user input, and more detailed docstrings. It's now more robust and readable.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Code enhancements in binary_insertion_sort.py
* [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: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* don't need to return list because list is mutable
* Don't need to return list as list is mutable
* use advantage of python in swapping
* filter blank inputs from input list
* minor changes
* minor mistake
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* more readable
* Update double_sort.py
* last fixes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* add tests for tree_sort
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update tree_sort.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add typing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Jeremy Tan <jeremytan@stripe.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* pre-commit: Upgrade psf/black for stable style 2023
Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310
> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…
Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.
I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* 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>
* Updated info
Updated the readme section for sorts.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update sorts/README.md
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update README.md
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
As described in #6095, this reduces the chances to observe a O(n^2) complexity.
Here, `collection.pop(pivot_index)` is avoided for performance reasons.
Fixes: #6095
* fixed wrong algo name to radix sort
* added wiki url
* Added "source" in docstring
* Update radix_sort.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixed bug where array length 2 can't be sorted
* Add MCC and DU path test
Add test to conversions/octal_to_decimal.py and sorts\iterative_merge_sort.py
* ""
* Update octal_to_decimal.py
Co-authored-by: John Law <johnlaw.po@gmail.com>