GitHub

shrink_shell_sort.py

(determined by the gap). If the element at the higher ...
GitHub

shrink_shell_sort.py

is repeated until the gap is equal to 1. The reason this is more efficient is that it reduces the number of comparisons that need to be made. By using a smaller gap, the list is sorted more quickly.