1.

Explain the memory representation of two-dimensional array.

Answer»

Let A be two-dimensional array
Let M is rows and N is columns

The array may be stored in the memory in one of the following methods:

1. Row-major representation:
In this type of method, the first row occupies the first set of memory locations reserved for the array and second-row occupies the next set and so on.

2. Column-major representation:
In this type of method, the first column occupies the first set of memory locations reserved for the array and the second column occupies the next set and so on.



Discussion

No Comment Found

Related InterviewSolutions