mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-18 01:00:15 +00:00
Optimization shell sort (#4119)
* optimization * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
parent
71b1202d04
commit
67b33a295b
|
@ -26,7 +26,8 @@ def shell_sort(collection):
|
|||
while j >= gap and collection[j - gap] > insert_value:
|
||||
collection[j] = collection[j - gap]
|
||||
j -= gap
|
||||
collection[j] = insert_value
|
||||
if j != i:
|
||||
collection[j] = insert_value
|
||||
return collection
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user