Question: Consider a two - dimensional array A of integer with M rows and N columns. What will be the formula for the address of A

Consider a two-dimensional array A of integer with M rows and N columns. What will be the formula for the address of A[i,j](in terms of the ado in column major order? You may assume that any integer occupies 4 bytes of memory.
Address(A[i][j])= address of A[0][0]+(i*M+j)*4
Address(A[i][j])= address of A[0][0]+(i*N+j)*4
Address(A[i][j])= address of A[0][0]+(j*M+i)*4
Address(A[i][j])= address of A[0][0]+(j*N+i)*4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!