If a 2-d matrix were to be represented in (a) row-major order and (b) column-major order, what would be the corresponding index given the indices of the 2-d matrix?
Suppose the matrix is mxn, we want to access a[x][y]
Row-major order: x*n+y
Col-major order: y*m+x
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment