diff --git a/lsn5AlS.c b/lsn5AlS.c new file mode 100644 index 0000000..c9deecf --- /dev/null +++ b/lsn5AlS.c @@ -0,0 +1,106 @@ +#include +#include +#include + +void swap(int *a,int*b) +{ + int sw=*a; + *a=*b; + *b=sw; +} + +void Shell (int* array,int len) +{ + int i; + int j; + int step; + int temp; + for (step =len/2;step>0;step /=2) + { + for(i=step;i=step;j-=step) + { + if (tempx) j--; + if (i<=j) + { + swap(&array[i],&array[j]); + i++; + j--; + } + } while(i<=j); + if(i