879 views
0 votes
0 votes
Find the address of the position [10, 11, 12] of array A in column major order? Given  
Dimension is A[1:10, -5:15, -10:15], w is two word count, and Base address is 200.

1 Answer

0 votes
0 votes
base=200
size=2
given array=[10][15][15]
                         l      m   n
             
find=[10][11][12]
            k     i     j
first element=[1][-5] [-10]
                        k0   i0     j0

formula for column major order

A[k][i][j]= (((k-k0)*m*n)+((j-1)*m)+(i-1))*size+base

=(10-1)*15*15+(12-(-10)*15)+(11-(-5))*2+200
=(2025+330+16)*2+200
=5142

Related questions

0 votes
0 votes
0 answers
1
Mayankprakash asked Nov 2, 2018
514 views
Please provide link or gatetoverflow link so that I can learn address calculation of 2d and 3d array.As I find it very tough to understand.Thanks
3 votes
3 votes
1 answer
2
dragonball asked Jan 2, 2018
19,728 views
Plz discuss every part with detailed solution with diagram .
4 votes
4 votes
1 answer
3
0 votes
0 votes
1 answer
4