From 5c20da00ead34757da5a9eab2eea9511a36b9a74 Mon Sep 17 00:00:00 2001 From: Ved Prakash Bhaskar <56016547+iamvpbhaskar@users.noreply.github.com> Date: Wed, 27 Oct 2021 00:57:08 +0530 Subject: [PATCH] created Sorting an Array using Shell Sort --- Merging & Sorting/Array-Shellsort.c | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Merging & Sorting/Array-Shellsort.c 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