Question: Permute the loops in the following function so that it scans the three-dimensional array a with a stride-1 reference pattern. 1234567 8 9 10 11
Permute the loops in the following function so that it scans the three-dimensional array a with a stride-1 reference pattern.
![1234567 8 9 10 11 12 13 int productarray3d (int a[N] [N] [N]) int i, j, k, product for (i = N-1; i >= 0; i--)](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1698/2/2/2/0986538d012bca7a1698222097652.jpg)
1234567 8 9 10 11 12 13 int productarray3d (int a[N] [N] [N]) int i, j, k, product for (i = N-1; i >= 0; i--) { for (j N-1; j >= 0; j--) { { } } = = } return product; 1; for (k = N-1; k >= 0; k--) { product = a[j] [k] [i]; }
Step by Step Solution
3.51 Rating (161 Votes )
There are 3 Steps involved in it
To create a stride1 reference pattern the loops must be permuted so that the righ... View full answer
Get step-by-step solutions from verified subject matter experts
