sorts.shell_sort

https://en.wikipedia.org/wiki/Shellsort#Pseudocode

Attributes

user_input

Functions

shell_sort(→ list[int])

Pure implementation of shell sort algorithm in Python

Module Contents

sorts.shell_sort.shell_sort(collection: list[int]) list[int]

Pure implementation of shell sort algorithm in Python :param collection: Some mutable ordered collection with heterogeneous comparable items inside :return: the same collection ordered by ascending

>>> shell_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> shell_sort([])
[]
>>> shell_sort([-2, -5, -45])
[-45, -5, -2]
sorts.shell_sort.user_input