Two-dimensional array is represented in memory in following two ways:
1. Row major representation: To attain this linear representation, the first row of the array is kept in the first memory locations reserved for the array, then the second row and so on.
2. Column major representation: Here all the elements of the column are kept next to one another.