mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-28 21:45:27 +08:00
e49caf57d016c86ea974f92d4e44ce1c93eb386a
* types(reverse_selection): constrain items to Comparable Bind reverse_selection_sort's element type to a Comparable Protocol so the signature says "a list of items that can be compared with each other" instead of a bare list, and keep the element type in the return. reverse_subarray only swaps elements and never compares them, so its TypeVar stays unbounded. Also adds doctests for a comparable non-int type (strings, floats) and for the failure mode: mixing non-comparable items must raise TypeError rather than silently mis-sort. The test battery picks the sort up for the shared cases and for the rejection check. * updating DIRECTORY.md --------- Co-authored-by: AuroraAeon <auroraeon@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: cclauss <cclauss@users.noreply.github.com>
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.
Description
No description provided
algorithmalgorithm-competitionsalgorithms-implementedalgoscommunity-driveneducationhacktoberfestinterviewlearnpracticepythonsearchessorting-algorithmssorts
Readme
460 MiB
Languages
Python
99.8%
Shell
0.2%