diff --git a/sorting/shell.py b/sorting/shell.py new file mode 100644 index 0000000..1d791ca --- /dev/null +++ b/sorting/shell.py @@ -0,0 +1,22 @@ +def shellSort(input_list): + + gap = len(input_list) // 2 + while gap > 0: + + for i in range(gap, len(input_list)): + temp = input_list[i] + j = i + + + while j >= gap and input_list[j - gap] > temp: + input_list[j] = input_list[j - gap] + j = j-gap + input_list[j] = temp + + + gap = gap//2 + +list =list(map(int,input().split())) +shellSort(list) +print(list) +