Question: Divide this piece of code into sequential and parallel sections. Identify the potential kernels in the code. Calculate the complexity of the code using a

Divide this piece of code into sequential and parallel sections. Identify the potential kernels in the code. Calculate the complexity of the code using a polynomial, and express this in Big O notation.
#include
#include
int main(void)
{
FILE * fp;
fp = fopen("centroid_2d_object.dat", "w");
int N =12;
int i;
double x[]={-1.5,-0.5,-0.5,0.5,2.0,2.5,1.0,-1.5,-2.0,1.0,-0.5,2.0};
double y[]={1.5,1.5,0.5,-0.5,1.0,-1.5,-2.5,1.5,2.0,-2.0,3.0,-1.5};
double t[]={0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001} ;
double l[]={1,1,1,1,1,1,1,1,1,1,1,1};
double w[]={1,1,1,1,1,1,1,1,1,1,1,1};
double A[N],V[N];
double sumV =0.0;
double sumVx =0.0;
double sumVy =0.0;
double x_cg,y_cg;
for(i=0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!