398 views
0 votes
0 votes

 

In a lower triangular matrices (size 15 × 15) representation of compact single dimensional array, non-zero elements (i.e. elements of the lower triangle) of each row are stored one after another, starting from the first row. Assume each integer take 1B. The array stored in row major order and first element of array is stored at location 1000, then the address of element A[10][6]

1 Answer

0 votes
0 votes

lower triangular matrix [15][15] have first row 1 element, 2nd row 2 element, 3rd row 3 element......15th row 15 element.

Now for [10][6], we need to cross 9 row and when we reach in 10th row we have to cross 5 element. than we will reach beginning of [10][6].

then number of element passed are (1+2+3...+9)+5=50

then the address= 1000+50=1050

Note: array's first element should have the address 1000. mean either [1][1] or [0][0] you are assuming as array's first element should have the address 1000. on the basis of that you will get only 1050 as answer address for [10][6] what ever you assume earlier

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
tishhaagrawal asked Dec 16, 2023
308 views
Below is my approach to solving this question, can anyone please explain if I am doing it the right way?Let X = #free slotssince, m =7 and n = 3So, $4 \leqslant x\leqsla...
0 votes
0 votes
0 answers
3
Dadu asked Dec 7, 2023
198 views
Please solve I am unable to understand the solution given by made easy