def shell_sort(arr):
n = len(arr)<EOL>gap = n//<NUM_LIT:2><EOL>while gap > <NUM_LIT:0>:<EOL><INDENT>y_index = gap<EOL>while y_index < len(arr):<EOL><INDENT>y = arr[y_index]<EOL>x_index = y_index - gap<EOL>while x_index >= <NUM_LIT:0> and y < arr[x_index]:<EOL><INDENT>arr[x_index + gap] = arr[x_index]<EOL>x_index = x_index - gap<EOL><DEDENT>arr[x_index + gap] = y<EOL>y_index = y_index + <NUM_LIT:1><EOL><DEDENT>gap = gap//<NUM_LIT:2><EOL><DEDENT>return arr<EOL>
Shell Sort
        Complexity: O(n^2)