Commit Graph
11 Commits
Author SHA1 Message Date
余枫andChristian Clauss 4dcd68eedd sorts: make exchange_sort generic for comparable items (#15304)
* sorts: make exchange_sort generic for comparable items

* Ints and floats are comparable

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-12 22:34:45 +02:00
Christian Clauss 0525ef5da8 ruff rule ANN202 missing-return-type-private-function (#15298)
* ruff rule ANN202 missing-return-type-private-function

* ruff rule ANN202 missing-return-type-private-function
2026-09-12 21:47:08 +02:00
Orji PatriciaandChristian Clauss d502013438 sorts: make comb_sort generic for comparable items (#15288)
* sorts: make comb sort generic for comparable items

* tests: cover comb sort incomparable inputs

* Update sorts/comb_sort.py

* Apply suggestion from @cclauss

* Apply suggestion from @cclauss

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-12 07:53:55 +02:00
Ge YingshanandGavin-Yau 26e4320885 sorts: type cocktail shaker sort for comparable items (#15278)
Co-authored-by: Gavin-Yau <2695188238@qq.com>
2026-09-11 23:59:59 +02:00
bpiper02 6a8f4ed4bf Make gnome sort generic over comparable items (#15261) 2026-09-10 17:50:21 +02:00
Christian Clauss 8a138809fa test_sorts with dataclasses and namedtuples (#15260) 2026-09-10 05:19:12 +02:00
Hanazar OchikawaandChristian Clauss 9e1cf59796 sorts: support comparable items in circle_sort (#15244)
* sorts: support comparable items in circle_sort

* style: format circle_sort

* Apply batched suggestions from code review

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

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-09 22:31:35 +00:00
Harsh Raj SinghaniaHarsh Raj SinghaniaChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
5ce67332fc sorts: type bubble sort for any comparable items (#15240)
* sorts: type bubble sort for any comparable items

Bound bubble_sort_iterative and bubble_sort_recursive to a Comparable protocol instead of Any, add TypeError doctests, and cover the mixed-type failure in tests/test_sorts.py.

Refs #15234

* Update tests/test_sorts.py

* Add binary insertion sort to tests and rename function

Updated tests to include binary insertion sort and renamed test function.

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

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

---------

Co-authored-by: Harsh Raj Singhania <harshrajsinghania@proton.me>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-09 16:55:55 +02:00
Sneha Kumaripre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
d0f9b6e061 Improve binary insertion sort comparable typing (#15238)
* Improve binary insertion sort comparable typing

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

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

* Update binary_insertion_sort function signature

* [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>
2026-09-09 15:41:01 +02:00
priya-sundaram-dev 9cac6fb26c tests: parametrize sorts/ over a shared input battery (#15185) 2026-09-04 20:57:54 +02:00
NavanithaSripre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
818ecfa4cb Add pytest for heap_sort (#13231)
* Add pytest for heap_sort

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

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

* Add __init__.py to tests to fix Ruff namespace package error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-04 19:52:14 +02:00