MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / shellSort

Function shellSort

Sorting Algorithms/shell_sort.py:1–13  ·  view source on GitHub ↗
(input_list)

Source from the content-addressed store, hash-verified

1def shellSort(input_list):
2 gap = len(input_list) // 2
3 while gap > 0:
4 for i in range(gap, len(input_list)):
5 temp = input_list[i]
6 j = i
7# Sort the sub list for this gap
8 while j >= gap and input_list[j - gap] > temp:
9 input_list[j] = input_list[j - gap]
10 j = j-gap
11 input_list[j] = temp
12# Reduce the gap for the next element
13 gap = gap//2

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected