Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ GetCols
Function
GetCols
recipes/Python/577084_shell_sort/recipe-577084.py:2–8 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
1
def
ShellSort(A):
2
def
GetCols(n):
3
cols = [1]
4
val = 1
5
while
val < n:
6
val = int(val * 2.2)
7
cols.insert(0, val)
8
return
cols
9
10
for
h in GetCols(len(A)):
11
for
i in range(h, len(A)):
Callers
1
ShellSort
Function · 0.85
Calls
1
insert
Method · 0.45
Tested by
no test coverage detected