Given a 2×3 array,
[1,2,3]
[4,5,6]
it is easy to store this linearly using row major order storage -> [1,2,3,4,5,6]
A particular row, column in the multidimensional array can be converted into a index in this linear array using the formula:
index = row*NumCol + column
Is there a way to compute the row,column given some index in the linear array.
So given index=1, value 2 in the linear array, is there a way to determine that row=0 column=1?
It is simple: