2 * Recursive parallel prefix with auxiliary array y
4 #include "algorithm_1.h"
6 void algorithm_1 (numtype x[], int n, int ops[]) {
13 for (i=0; i < (n/2); i++) {
14 y[i] = x[2*i] + x[2*i+1];
17 algorithm_1(y, n/2, ops);
21 for (i = 1; i < (n/2); i++){
22 x[2*i] = y[i-1] + x[2*i];
26 x[n-1] = y[n/2-1] + x[n-1];