# define N 10
Void quicksort (int a [], int low, int high);
Int the split (int a [], int low, int high);
Int main (void) {
Int a [N], I;
Entr printf (" % d items to be sorted: ", N);
for(i=0; i
A, quicksort (0, N - 1);
Printf (" the sorted items are: ");
for(i=0; i
return 0;
}
Int the split (int a [], int low, int high) {
Int w=a, [low].
For (;; ) {
While (low
A [low++]=a, [high].
While (low
If (low>=high) break;
A (high -)=a, [low].
}
A [high]=w;
Return high;
}
Void quicksort (int a [], int low, int high) {
Int the middle;
If (low>=high) return;
Middle=split (a, low, high);
Quicksort (a, low, middle - 1);
Quicksort (a, middle - 1, high);
}
CodePudding user response:
Array declaration, N no value is variable, you don't have to a dynamic array