In computing, row-major order and column-major order describe methods for storing multidimensional arrays in linear memory. Following standard matrix notation, rows are numbered by the first index of a two-dimensional array and columns by the second index. Array layout is critical for correctly passing arrays between programs written in different languages. It is also important for performance when traversing an array because accessing array elements that are contiguous in memory is usually faster than accessing elements which are not, due to caching.
Row-major order is used in C, PL/I, Python and others. Column-major order is used in Fortran, MATLAB, GNU Octave, R, Rasdaman, X10 and Scilab.
Read more about Row-major Order: Row-major Order, Column-major Order, Generalization To Higher Dimensions
Famous quotes containing the word order:
“He had discovered a great law of human action, without knowing itnamely, that in order to make a man or a boy covet a thing, it is only necessary to make the thing difficult to attain. If he had been a great and wise philosopher, like the writer of this book, he would now have comprehended that Work consists of whatever a body is obliged to do and that Play consists of whatever a body is not obliged to do.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)