80 register double t = (a); \
85double quickSelect(
double *arr,
int n) {
92 median = (low + high) / 2;
99 if (high == low + 1) {
100 if (arr[low] > arr[high])
101 SWAP(arr[low], arr[high]);
106 middle = (low + high) / 2;
107 if (arr[middle] > arr[high])
108 SWAP(arr[middle], arr[high]);
109 if (arr[low] > arr[high])
110 SWAP(arr[low], arr[high]);
111 if (arr[middle] > arr[low])
112 SWAP(arr[middle], arr[low]);
115 SWAP(arr[middle], arr[low + 1]);
123 }
while (arr[low] > arr[ll]);
127 }
while (arr[hh] > arr[low]);
132 SWAP(arr[ll], arr[hh]);
136 SWAP(arr[low], arr[hh]);
168 w = calloc(
sizeof(*w), W);
169 for (i = 0; i < n; i++) {
170 for (k = 0; k < W; k++) {
174 }
else if (idx >= n) {
180 m[i] = quickSelect(w, W);