Skip to content

Commit 102bf71

Browse files
committed
add shell
1 parent 6db4783 commit 102bf71

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

docs/Shellsort.md

Whitespace-only changes.

sortingx/shell.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ def standard(array: List, reverse: bool=False) -> None:
1111
while gap >= 1:
1212
for index in range(length):
1313
next = index
14-
compare = array[next - gap] < array[next] if reverse else array[next - gap] > array[next]
15-
while next >= gap and compare: # insertion sort
14+
while next >= gap and array[next - gap] < array[next] if reverse else array[next - gap] > array[next]: # insertion sort
1615
array[next], array[next - gap] = array[next - gap], array[next]
1716
next -= gap
1817
gap //= 2 # renew

0 commit comments

Comments
 (0)