diff --git a/SORTING b/SORTING index 5918c98..0380e8b 100644 --- a/SORTING +++ b/SORTING @@ -1,5 +1,7 @@ #include #include +#include//time +#include//for sleep #define size 10 //shell sort void swap(int *x,int *y) @@ -70,6 +72,52 @@ for(exp=1;m/exp>0;exp*=10) countSort(A,n,exp); } } +//merge new technique-corrected +void merge(int A[],int l,int h,int mid) //we have to use mid otherwise 1 element will not get sorted and thius it will by default assign 0 +{ + int B[20]; + int i,j; +// int mid=(l+h)/2; + int k=mid+1; + i=l; + j=l; + while(i<=mid&&k<=h) + { + if(A[i]=0 && A[j]>x) + while(j>-1&& A[j]>x) { A[j+1]=A[j]; j--; } A[j+1]=x; + for(k=0;kA[j+1]) swap(&A[j],&A[j+1]); } +printf("Pass %d :\n",i); +for(k=0;k