0 votes 0 votes Explain the method to calculate the address of an element in an array. A 25*4 matrix array DATA is stored in memory in ‘row-major order’. If base address is 200 and 4 words per memory cell. Calculate the address of DATA [12, 3]…?? DS data-structures array matrix + – akama asked Sep 11, 2022 • recategorized Sep 11, 2022 by makhdoom ghaya akama 1.2k views answer comment Share Follow See 1 comment See all 1 1 comment reply Kabir5454 commented Sep 11, 2022 reply Follow Share each cell size =$4$ words array size =$25*4$ Data Stored in row major order. We need array[12,3] address . So we first have to cross all the element till 11th row . As each row has $4$ column so total no of element we crossed $4*12=48$ [considering array index start from 0th row so , $0$ to $11$ total $12$ rows each having $4$ elements]. Now we are at 12th row and we have to go to 3rd column 12th row so we have to $3$ element in that row . So total number of element we crossed =$(48+3)=51$ Each element size =4 word . So crossed =$51*4=204$ Base address =$200$ So the address of the cell array[12,3] =$200+204=404$. 2 votes 2 votes Please log in or register to add a comment.
1 votes 1 votes DATA[12,3]=200+4*(12*4+3)=404 ShubhamKumar7352 answered Dec 20, 2022 ShubhamKumar7352 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes ans=200+12*4*4-4+4*4 =404. ram6392912376 answered Oct 11, 2022 ram6392912376 comment Share Follow See all 0 reply Please log in or register to add a comment.