# DATA STRUCTURES

Suppose that the array B is stored linearly in column-major order, beginning in address beta.

i. If B is declared as B [1….3, 1….4] then what is the address of B[2,3].

ii. If B is declared as B [L1…U1, L2…U2,L3…U3] then what is the address of B[i,j,k].

What is the address of A[0,0,0] in an array stored linearly in row major beginning with address α if it is declared A[-5…0, -2…3, -2…0]

In a multi-dimensional array
If you want to find the address of array A,the loc(A[k1,k2,k3…kn]) , where k1 , k2 …kn are the values for which you must find the address like for the first case you pointed out B[2,3] so k1 = 2 && k2 = 3 , is given by :-

Column Major = Base (A) + w*[E1 + L1(E2 +(L2(E3+…)))…)EnLn-1)]

Row Major = Base (A) + w
[(((E1*L2+E2)L3+E3)L4)+…En-1)Ln + En]

where E is effective index and is given by Ei = ki - lower bound for the index i
And L1 , L2 , L3 …Ln is the length of the nth index
and w is the word size

For your clarity I made this one …Open the image in a new tab …And sorry we got so late to help you …