TheRodzzandChristian Clauss 5a6cc4869a fix(sorts): raise ValueError for negative inputs in radix_sort (#14950) (#14986)
* 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>
2026-09-09 14:18:19 +02:00
2025-07-06 01:35:29 +03:00
2026-09-05 20:05:56 +02:00

The Algorithms - Python

Gitpod Ready-to-Code Contributions Welcome Discord chat
GitHub Workflow Status pre-commit code style: black

All algorithms implemented in Python - for education 📚

Implementations are for learning purposes only. They may be less efficient than the implementations in the Python standard library. Use them at your discretion.

🚀 Getting Started

📋 Read through our Contribution Guidelines before you contribute.

🌐 Community Channels

We are on Discord! Community channels are a great way for you to ask questions and get help. Please join us!

📜 List of Algorithms

See our directory for easier navigation and a better overview of the project.

Languages
Python 99.8%
Shell 0.2%