diff --git a/Merging & Sorting/Array-Shellsort.c b/Merging & Sorting/Array-Shellsort.c new file mode 100644 index 0000000..9ba21a1 --- /dev/null +++ b/Merging & Sorting/Array-Shellsort.c @@ -0,0 +1,44 @@ +/* Shell Sort is mainly a variation of Insertion Sort. In insertion sort, we move elements only one position ahead. +When an element has to be moved far ahead, many movements are involved. */ + + /* C Program for Sorting an Array using Shell Sort */ +#include +#define MAX 100 + +int main() +{ + + int arr[MAX],i,j,k,n,incr; + + printf("\nEnter the number of elements : "); + scanf("%d",&n); + for(i=0;i=1) + { + for(i=incr; i=0 && k