[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>
This commit is contained in:
pre-commit-ci[bot]
2024-03-13 07:52:41 +01:00
committed by GitHub
parent 5f95d6f805
commit bc8df6de31
297 changed files with 488 additions and 285 deletions

View File

@@ -3,6 +3,7 @@ Python program for Bitonic Sort.
Note that this program works only when size of input is a power of 2.
"""
from __future__ import annotations

View File

@@ -27,6 +27,7 @@ If k = O(n), time complexity is O(n)
Source: https://en.wikipedia.org/wiki/Bucket_sort
"""
from __future__ import annotations

View File

@@ -23,7 +23,6 @@ For manual testing run:
python dnf_sort.py
"""
# Python program to sort a sequence containing only 0, 1 and 2 in a single pass.
red = 0 # The first color of the flag.
white = 1 # The second color of the flag.

View File

@@ -18,8 +18,7 @@ from typing import Any, Protocol, TypeVar
class Comparable(Protocol):
def __lt__(self, other: Any, /) -> bool:
...
def __lt__(self, other: Any, /) -> bool: ...
T = TypeVar("T", bound=Comparable)

View File

@@ -3,6 +3,7 @@ Introspective Sort is a hybrid sort (Quick Sort + Heap Sort + Insertion Sort)
if the size of the list is under 16, use insertion sort
https://en.wikipedia.org/wiki/Introsort
"""
import math

View File

@@ -4,6 +4,7 @@ It used the binary representation of the integers to sort
them.
https://en.wikipedia.org/wiki/Radix_sort
"""
from __future__ import annotations

View File

@@ -10,6 +10,7 @@ comparisons.
They are synchronized with locks and message passing but other forms of
synchronization could be used.
"""
from multiprocessing import Lock, Pipe, Process
# lock used to ensure that two processes do not access a pipe at the same time

View File

@@ -1,14 +1,15 @@
"""
This is an implementation of Pigeon Hole Sort.
For doctests run following command:
This is an implementation of Pigeon Hole Sort.
For doctests run following command:
python3 -m doctest -v pigeon_sort.py
or
python -m doctest -v pigeon_sort.py
python3 -m doctest -v pigeon_sort.py
or
python -m doctest -v pigeon_sort.py
For manual testing run:
python pigeon_sort.py
For manual testing run:
python pigeon_sort.py
"""
from __future__ import annotations

View File

@@ -7,6 +7,7 @@ python3 -m doctest -v quick_sort.py
For manual testing run:
python3 quick_sort.py
"""
from __future__ import annotations
from random import randrange

View File

@@ -3,6 +3,7 @@ This is a pure Python implementation of the radix sort algorithm
Source: https://en.wikipedia.org/wiki/Radix_sort
"""
from __future__ import annotations
RADIX = 10

View File

@@ -1,6 +1,7 @@
"""
A recursive implementation of the insertion sort algorithm
"""
from __future__ import annotations

View File

@@ -8,6 +8,7 @@ in their paper Pessimal Algorithms and Simplexity Analysis
Source: https://en.wikipedia.org/wiki/Slowsort
"""
from __future__ import annotations

View File

@@ -3,6 +3,7 @@ Tree_sort algorithm.
Build a Binary Search Tree and then iterate thru it to get a sorted list.
"""
from __future__ import annotations
from collections.abc import Iterator