GATE CSE
First time here? Checkout the FAQ!
x
+5 votes
99 views

Please explain how to solve this.

asked in DS by Boss (6k points)   | 99 views

2 Answers

+4 votes
Best answer

Correct me if i am wrong

answered by Active (1.2k points)  
selected by
Thanx nicely explained..:)
If the question was for column major then what will be the address.....???

I got 1046.....is it right...??
0 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

answered by (487 points)  


Top Users Jun 2017
  1. Bikram

    3704 Points

  2. Hemant Parihar

    1484 Points

  3. junaid ahmad

    1432 Points

  4. Arnab Bhadra

    1408 Points

  5. Niraj Singh 2

    1311 Points

  6. Rupendra Choudhary

    1194 Points

  7. rahul sharma 5

    1148 Points

  8. Debashish Deka

    1112 Points

  9. srestha

    932 Points

  10. Arjun

    930 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 19 - 25
  1. Bikram

    1960 Points

  2. Niraj Singh 2

    1306 Points

  3. junaid ahmad

    502 Points

  4. sudsho

    410 Points

  5. akankshadewangan24

    392 Points


23,361 questions
30,068 answers
67,376 comments
28,385 users