sorts.circle_sort ================= .. py:module:: sorts.circle_sort .. autoapi-nested-parse:: This is a Python implementation of the circle sort algorithm For doctests run following command: python3 -m doctest -v circle_sort.py For manual testing run: python3 circle_sort.py Attributes ---------- .. autoapisummary:: sorts.circle_sort.user_input Functions --------- .. autoapisummary:: sorts.circle_sort.circle_sort Module Contents --------------- .. py:function:: circle_sort(collection: list) -> list A pure Python implementation of circle sort algorithm :param collection: a mutable collection of comparable items in any order :return: the same collection in ascending order Examples: >>> circle_sort([0, 5, 3, 2, 2]) [0, 2, 2, 3, 5] >>> circle_sort([]) [] >>> circle_sort([-2, 5, 0, -45]) [-45, -2, 0, 5] >>> collections = ([], [0, 5, 3, 2, 2], [-2, 5, 0, -45]) >>> all(sorted(collection) == circle_sort(collection) for collection in collections) True .. py:data:: user_input