#include < stdio.h> #include < stdlib.h> #include < math.h> int T[10]={5,2,9,7,1,6,12,51,24,18}; int partition(int *T, int prime, int last) { int pivot = T[first], i = prime-1, j = last+1; int temp; while (true) { do j--; while (T[j] > pivot); do i++; while (T[i] < pivot); if (i < j) { temp = T[i]; T[i] = T[j]; T[j] = temp; } else return j; }}void tri_rapide(int T[], int first, int last){ int pivot; if(first < last) { pivot = partition(T,first, last); tri_rapide(T, first, pivot-1); tri_rapide(T, pivot+1, last); }}int main(){ tri_rapide(T,0,9); for (int i=0 ; i< 10 ; i++) printf("%d ",T[i]); return 0; }