sorts.exchange_sort

Attributes

user_input

Functions

exchange_sort(→ list[int])

Uses exchange sort to sort a list of numbers.

Module Contents

sorts.exchange_sort.exchange_sort(numbers: list[int]) list[int]

Uses exchange sort to sort a list of numbers. Source: https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort >>> exchange_sort([5, 4, 3, 2, 1]) [1, 2, 3, 4, 5] >>> exchange_sort([-1, -2, -3]) [-3, -2, -1] >>> exchange_sort([1, 2, 3, 4, 5]) [1, 2, 3, 4, 5] >>> exchange_sort([0, 10, -2, 5, 3]) [-2, 0, 3, 5, 10] >>> exchange_sort([]) []

sorts.exchange_sort.user_input