13 Commits
Author SHA1 Message Date
7dbc8a19da Fix tree_sort dropping duplicate values (#15381)
Node.insert ignored values equal to the current node, so
tree_sort([1, 1]) returned (1,). Send equal values to the right subtree and
add doctests for repeated values.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-20 23:13:55 +02:00
Pruthvi 5e4d68854a sorts: make tree_sort accept any Comparable items (#15361) 2026-09-18 02:45:20 +02:00
Drishti Tripathiandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> a0d8feb973 Fix/tree sort iterable type hint (#14701)
* sorts/tree_sort: use Iterable type hint and enable range doctest

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* sorts/tree_sort: fix Iterable support using iter() and next()

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-09 13:59:07 +02:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> bc8df6de31 [pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [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>
2024-03-13 07:52:41 +01:00
Christian Clauss 3923e590d7 Tree_sort.py: Disable slow doctest (#10584) 2023-10-16 10:17:48 -04:00
Gabrielly de S. Pinto Dantaspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
1a26d76c60 add tests for tree_sort (#10015)
* 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>
2023-10-16 02:44:10 +02:00
CaedenChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
07e991d553 Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062)
* ci(pre-commit): Add pep8-naming to `pre-commit` hooks (#7038)

* refactor: Fix naming conventions (#7038)

* Update arithmetic_analysis/lu_decomposition.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor(lu_decomposition): Replace `NDArray` with `ArrayLike` (#7038)

* chore: Fix naming conventions in doctests (#7038)

* fix: Temporarily disable project euler problem 104 (#7069)

* chore: Fix naming conventions in doctests (#7038)

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-13 00:54:20 +02:00
21ed8968c0 Fixes in Bidirectional A* (#2020)
* implement bidirectional astar

* add type hints

* add wikipedia url

* format with black

* changes from review

* fix collision check

* Add testmod()

* # doctest: +NORMALIZE_WHITESPACE

* Codespell: euclidean

* Codespell: coordinates

* Codespell: traversal

* Codespell: remaining

Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2020-05-21 21:50:52 +02:00
William Zhang 9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
PatOnTheBack bd4017928e Added Whitespace and Docstring (#924)
* Added Whitespace and Docstring

I modified the file to make Pylint happier and make the code more readable.

* Beautified Code and Added Docstring

I modified the file to make Pylint happier and make the code more readable.

* Added DOCSTRINGS, Wikipedia link, and whitespace

I added DOCSTRINGS and whitespace to make the code more readable and understandable.

* Improved Formatting

* Wrapped comments
* Fixed spelling error for `movement` variable
* Added DOCSTRINGs

* Improved Formatting

* Corrected whitespace to improve readability.
* Added docstrings.
* Made comments fit inside an 80 column layout.
2019-07-01 16:10:18 +08:00
Mehdi ALAOUI 02c0daf9e5 Adding unit tests for sorting functions, and improving readability on some sorting algorithms (#784)
* Adding variable to fade out ambiguity

* More readability on merge sorting algorithm

* Updating merge_sort_fastest description and explaining why

* Adding tests file with imports

* Standardazing filenames and function names

* Adding test cases and test functions

* Adding test loop

* Putting 'user oriented code' inside main condition for having valid imports

* Fixing condition

* Updating tests: adding cases and todo list

* Refactoring first euler problem's first solution
2019-05-25 21:41:24 +08:00
ParthS007 0856a61859 Remove Multiple Unused Imports and Variable 2018-10-18 02:58:57 +05:30
Sichen Liu 744dd71238 Add sorts for python3 2018-03-03 21:27:05 -05:00