Question: struct algae _ position { float x; float y; } ; struct algae _ position grid [ 1 6 ] [ 1 6 ] ;

struct algae_position {
float x;
float y;
};
struct algae_position grid[16][16];
float total_x =0, total_y =0;
int i,j;
You should also assume the following:
sizeof(float)==4.
grid begins at memory address 0.
The cache is initially empty.
The only memory accesses are to the entries of the grid array grid. the variables i, j, total x, total y are stored in registers.
We consider the following code:
for (i =0; i <16; i++){
for (j =0; j <16; j++){
total_x += grid[j][i].x;
total_y += grid[j][i].y;
}}

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 Databases Questions!