#include #include #include #include #include #include using namespace std; template void swap(Type array[],int i, int j) { Type tmp=array[i]; array[i]=array[j]; array[j]=tmp; } template void quicksort( Type array[], int l, int r) { int i=l; int j=r; Type v=array[int((l+r)/2)]; for (;;) { while (array[i] < v) i=i+1; while (v < array[j]) j=j-1; if (i<=j) { swap(array,i,j); i=i+1 ; j=j-1; } if (i>j) goto ended ; } ended: ; if (l void print(Type array[],int size) { char file_name[] ="sorted.txt"; ofstream output(file_name); for (int i=0;i> x[i] ; } time(&local_time); cout << " read " << endl; printf("%s",ctime(&local_time)); cout << " Quicksort of integer array is \n"; quicksort(x,0,size-1); time(&local_time); cout << " Sort " << endl; printf("%s",ctime(&local_time)); print(x,size); time(&local_time); cout << " print " << endl; printf("%s",ctime(&local_time)); return(0); }