mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Fix pre-commit error on master (#3992)
* Update pigeon_sort.py * updating DIRECTORY.md * Add type hints and return annotation Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
parent
07a4ce9fb8
commit
f8b2c43fda
|
@ -250,6 +250,7 @@
|
||||||
* [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py)
|
* [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py)
|
||||||
|
|
||||||
## Electronics
|
## Electronics
|
||||||
|
* [Electric Power](https://github.com/TheAlgorithms/Python/blob/master/electronics/electric_power.py)
|
||||||
* [Ohms Law](https://github.com/TheAlgorithms/Python/blob/master/electronics/ohms_law.py)
|
* [Ohms Law](https://github.com/TheAlgorithms/Python/blob/master/electronics/ohms_law.py)
|
||||||
|
|
||||||
## File Transfer
|
## File Transfer
|
||||||
|
|
|
@ -9,9 +9,10 @@
|
||||||
For manual testing run:
|
For manual testing run:
|
||||||
python pigeon_sort.py
|
python pigeon_sort.py
|
||||||
"""
|
"""
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
def pigeon_sort(array):
|
def pigeon_sort(array: List[int]) -> List[int]:
|
||||||
"""
|
"""
|
||||||
Implementation of pigeon hole sort algorithm
|
Implementation of pigeon hole sort algorithm
|
||||||
:param array: Collection of comparable items
|
:param array: Collection of comparable items
|
||||||
|
@ -52,6 +53,7 @@ def pigeon_sort(array):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
user_input = input("Enter numbers separated by comma:\n")
|
user_input = input("Enter numbers separated by comma:\n")
|
||||||
unsorted = [int(x) for x in user_input.split(",")]
|
unsorted = [int(x) for x in user_input.split(",")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user