Commit 5a6cc48
* fix(sorts): raise ValueError for negative inputs in radix_sort (#14950)
This commit updates `radix_sort()` to validate that all integers in `list_of_ints` are non-negative.
Radix sort relies on digit-by-digit sorting and only supports non-negative integers.
If any negative integer is present in `list_of_ints`, `radix_sort()` now raises a `ValueError`.
Empty list input is also handled gracefully. Additionally, pre-commit noqa annotations are updated where needed.
Fixes #14950
* Apply suggestion from @cclauss
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 8870905 commit 5a6cc48
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
0 commit comments