Question
An array T[20][10] is stored in the memory along the column with each of the element occupying 2 bytes, find out the memory location of T[10][5], if an element T[2][9] is stored at location 7600.
Solution
AssumingLBR=LBC=0
B=7600
W=2 bytes
Number of Rows(N)=20
Number of Columns(M)=10
LOC(Arr[I] [J]) = B +(I + J*N)*W
LOC(T[10][5]) = 7600+(10+5*20)*2
= 7600 + (300*2)
= 7600 + 600
= 8200