PRASHNIKAप्रश्निका
‹ Back to the paper

A matrix is stored with each element requiring 8 bytes of storage. If the base address at is 1400…

Computer Science20172 marksOne word
A matrix $P[15][10]$ is stored with each element requiring 8 bytes of storage. If the base address at $P[0][0]$ is 1400, determine the address at $P[10][7]$ when the matrix is stored in Row Major Wise.

Answer

Answer

AI
2256 Row major: Address of $P[i][j]$ = Base + W x [i x N + j] (lower bounds 0), where N = number of columns = 10 and W = 8. Address of $P[10][7]$ = 1400 + 8 x [10 x 10 + 7] = 1400 + 8 x 107 = 1400 + 856 = 2256.
Arrays, Strings

From ISC 2017 Computer Science Paper 1, question 2(c).