sorts.pigeon_sort

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

For manual testing run: python pigeon_sort.py

Attributes

user_input

Functions

pigeon_sort(→ list[int])

Implementation of pigeon hole sort algorithm

Module Contents

sorts.pigeon_sort.pigeon_sort(array: list[int]) list[int]

Implementation of pigeon hole sort algorithm :param array: Collection of comparable items :return: Collection sorted in ascending order >>> pigeon_sort([0, 5, 3, 2, 2]) [0, 2, 2, 3, 5] >>> pigeon_sort([]) [] >>> pigeon_sort([-2, -5, -45]) [-45, -5, -2]

sorts.pigeon_sort.user_input