Each element of an array arr[20][50] requires 4 bytes of storage . base address of arr is 2000. the location of arr[10][10] when the array is stored as column major is
Answers
Answered by
5
Answer:
2840
column major = B + W *[(M * (J - Lc) + (I - Lr))]
Attachments:
Answered by
4
Given,
Element of an array arr [20][50]
Storage required = 4 bytes
Base address of arr = 2000
To find,
Location of arr [10][10] when the array is stored in column-major
Solution,
Column Major = B + W [(M(J - Lc) + (l - LR))]
Location = 2000 + 4 ((10 - 0) x 20 + (10 - 0))
= 2840
Thus, the location is 2840.
Similar questions