310 views
1 votes
1 votes

Sartaj Sahani Chapter 7 question 9

I seem to have stumbled upon something very basic, and I can't figure out why.

The question asks "How large can the ratio of two memory requirements get?" when a 2D Array is stored as a 2d array in c++ and when stored as a 1D array by row major mapping.

The solution is given here https://www.cise.ufl.edu/~sahni/dsaac/public/exer/c7/e9.htm

What i don't understand is how  (4mn + 4m) / (4mn) = 1 + 4/n.

Shouldn't it be 1 +1/n ?

Can anyone help me out here ?

Thanks.

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
13 votes
13 votes
8 answers
3
Na462 asked Aug 22, 2018
5,481 views
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory...