Arrays & Linked Lists
![Question 2.14, GATE 1998: A[1…10][1…15] is stored in row-major order, uses one memory location per integer, and A[1][1] is at 100. Find address A[i][j].](../../assets/questions/CS-1998-Q49-1.webp)
Your answer
Answer & solution
Answer: A: 15i+j+84 (no official key was published)
Before row i there are i−1 complete rows, each containing 15 entries, contributing 15(i−1) locations. Within row i, column j is j−1 locations beyond its start. Add the base:100+15(i−1)+(j−1)=15i+j+84. This is A. Check i=j=1 gives 100, and increasing j by 1 advances one location, whereas increasing i by 1 advances fifteen. Those checks distinguish row-major from column-major formulas.