# Include
Void fun (int array [], int low, int high) {int I = low; int j = high; int temp = array [I]; while (I <j) {while (array [j]> = temp) & (I <j) {j --; array [I] = array [j];} while (array [I] <= temp) & (I <j) {I ++; array [j] = array [I] ;}} array [I] = temp; if (I-1> low) {fun (array, low, I-1);} if (high> I + 1) {fun (array, j + 1, high) ;}else {return ;}} void main () {int array [10]; printf ("Enter ten digits to search for the k-th small element: \ n "); for (int I = 0; I <10; I ++) {printf (" Enter the % d count: ", I + 1 ); scanf ("% d", & array [I]);} fun (array,); int k; printf ("Enter the smallest elements to search :"); scanf ("% d", & k); printf ("this element is: % d", array [k-1]); printf ("\ n ");} 2 # include
# Include
Void interchange (int * m, int * n) {int temp = * m; * m = * n; * n = temp;} int partition (int array [], int p, int q) {int I, j; I = p; j = q + 1; while (1) {do I ++; while (array [I] array [p]) & (j! = P); if (I
> N; int * a = (int *) malloc (n * sizeof (int); for (I = 0; I
> A [I];} cout <
I; if (I <= n) break; cout <"overflow! "<