Research Article
Source Codes Oriented Software Trustworthiness Measure Based on Validation
Algorithm 1
Quick sort program written in the C language.
| #include stdio.h | | int Partition(int R,int i,int j) | | | int pivot=R; | | while(i<j) | | | while(i<j&&R[j]>=pivot) | | j--; | | if(i<j) | | R[i++]=R; | | while(i<j&&R[i]<=pivot) | | i++; | | if(i<j) | | R[j- -]=R[i]; | | | R=pivot; | | return i; | | | void QuickSort(int R,int low,int high) | | | int pivotpos; | | if(low<high) | | | pivotpos=Partition(R,low,high); | | QuickSort(R,low,pivotpos-1); | | QuickSort(R,pivotpos+1,high); | | | //QuickSort | | int main() | | | int s; | | printf(input 10 number); | | for(int i=0;i<10;i++) | | | scanf(%d,&s); | | | QuickSort(s,0,9); | | for (int j=0;j<10;j++) | | | printf(%d ,s); | | |
|