Column Major Representation
In memory the second method of representing two-dimensional array is the column major representation. Under this illustration, the first column of the array occupies the first set of the memory locations kept for the array. The second column occupies next set & so forth. The representation of a column major representation is illustrated in Figure
Assume the following two-dimensional array:
To make its equivalent column major representation, we carry out the following procedure:
Transpose the elements of the array. After that, the representation will be alike as that of the row major representation.
Through application of above denoted process, we get {a, e, i, b, f, j, c, g, k, d, h, i}
Col 0
|
Col 1
|
Col 2
|
.....
|
Col i
|
|
|
Figure: Schematic of Column major representation of an Array
1) In which array can be stored?
2) In which, the elements of array are stored row wise.
3) In which, the elements of array are stored column wise.