2 votes 2 votes Consider a lower triangular Matrix A[-25....+25, -25....+25], base address (BA)=0, size of element = 100 Byte. Find the location of a [-20][-21] (Ordering: Row Major)? Programming in C array programming-in-c data-structures + – Beyonder asked Dec 20, 2017 Beyonder 2.0k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply joshi_nitish commented Dec 20, 2017 reply Follow Share if qsn is correct, it should be 1900 0 votes 0 votes Ashwin Kulkarni commented Dec 20, 2017 reply Follow Share okay got it now. It is 1900 lower triangular matrix has 15 elements upto 5th row and + 4 need to be traverse . = 19*100 = 1900 Thanks @nitish. 2 votes 2 votes Anu007 commented Dec 20, 2017 reply Follow Share Row major= {([-20 +25] *[-20 +25 +1])/2 + ([-21 +25])}*100 = {15+ 4} *100 = 1900 0 votes 0 votes hs_yadav commented Dec 20, 2017 reply Follow Share -25(1) -24(2) -23(3) -22(4) -21(5) ...(5*6/2 =15 elements) -20th row .... -25 -24 -23 -22 after this -21 ...total no. of passed element ---19 and memory occupied 1900 .... a[-20,-21]= 1900+0 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes $a[-25....+25][-25....+25]$ $BA=0$ $Size\ of\ element=100\ B$ $Loc[-20][-21]$ $\\ =\left \{\underbrace {-20+25=5}+(-21+25) \right \}\times 100$ $Natural\ \#\ sum\\ of\ 5\ rows$ $=\left \{ \dfrac{5\times 6}{2}\ +\ 4 \right \}\times 100$ $=\left \{ 15+4 \right \}\times 100$ $=1900$ KUSHAGRA गुप्ता answered Dec 27, 2019 KUSHAGRA गुप्ता comment Share Follow See all 3 Comments See all 3 3 Comments reply Ram Swaroop commented Jan 26, 2020 reply Follow Share @Kushagra गुप्ता Numbers of rows= (i-lower bound) Like as -20-(-25)= 5 ? 0 votes 0 votes KUSHAGRA गुप्ता commented Jan 26, 2020 reply Follow Share Yes ! 0 votes 0 votes sumit576 commented Sep 9, 2022 i edited by sumit576 Sep 9, 2022 reply Follow Share Why there is (5*6)/2 ? Can anyone explain? The Ans is 2900. 0 votes 0 votes Please log in or register to add a comment.