533 views
6 votes
6 votes

Please explain how to solve this.

3 Answers

Best answer
7 votes
7 votes

Correct me if i am wrong

selected by
1 votes
1 votes

If we take the size of each element as 1 bytes. 

Then its actually asking for the address of A[4][2] in the lower triangular matrix.

In Row Major Order, A[i][j] = Base + Size( (i - lower1) *NNS + (j-lower2) )     //NNS = Natural No.Sum.

So, A[4][2] = 1000 + 1 ( ( 4-(-6) )*NNS + (2-(-6) ) )

                  = 1000 + (1+2+3+4+5+6+7+8+9+10) + 8

                  = 1000 + 55 + 8

                  = 1063

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
bhavnakumrawat5 asked Jul 23, 2018
326 views
how the get 3n/2 -2 comparision
1 votes
1 votes
1 answer
3
Anmol pratap singh asked Jul 8, 2023
577 views