Consider 3 dimensional Array A[90] [30] [40] stored in linear array. If the base address starts at 10, The location of A [20] [20] [30] in case of RMO and CMO are ________. (Assume the first element is stored at A[1][1][1] and each element take 1 memory location)

A is an array [2.....6,2.....8,2.......10] of elements. The starting location is 500. The location of an element A(5,5,5) using column major order is __________.

The concept generalizes to arrays with more than two dimensions.

For a d-dimensional ${\displaystyle N_{1}\times N_{2}\times \cdots \times N_{d}}$ array with dimensions $N_{k} (k=1...d)$, a given element of this array is specified by a tuple $(n_1, n_2, \ldots, n_d)$ of d (zero-based) indices $n_k \in [0,N_k - 1].$

In row-major order, the last dimension is contiguous, so that the memory-offset of this element is given by:

In column-major order, the first dimension is contiguous, so that the memory-offset of this element is given by:

where the empty product is the multiplicative identity element, i.e.,