#include <stdio.h>//Array Length # define Length ((sizeof (array))/(sizeof (ARRAY[0)))/* * Quick Sort * * Parameter description: * A- -the array to be sorted * L--the left edge of the array (for example, starting from the start position, then l=0) * R--The right edge of the array (for example, sort up to the end of the array, then R=a.length-1) */void quick_sort (int a[], int l, int R) {if (L < r) {int i,j,x; i = l; j = r; x = A[i]; while (I < J) {while (I < J && A[j] > x) j--;//Right-to-left find the first number less than X if (I < j) {//a[i++] = a[j];a[i] = a[j];i++;} while (I < J && A[i] < x) i++; From left to right, find the first number greater than X if (I < j) {A[j] = a[i];j--;} } A[i] = x; Quick_sort (A, L, i-1); /* Recursive call */Quick_sort (A, i+1, R); /* Recursive call */}}void main () {int i; int a[] = {30,40,60,10,20,50}; int ilen = LENGTH (a); printf ("before sort:"); for (i=0; i<ilen; i++) printf ("%d", a[i]); printf ("\ n"); Quick_sort (A, 0, Ilen-1); printf ("After sort:"); for (i=0; i<ilen; i++) printf ("%d", a[i]); printf ("\ n");}