Data Structures and Algorithms - Old Questions

4. What are the difference between two dimension array and multidimension array?

5 marks | Asked in 2065

Two dimension (2D) array: 

A two-dimensional array is nothing but a matrix, that has rows and columns in it. For e.g.

    int a[3][4];

    float b[10][10];

Multidimensional array :

Any array which has a dimension higher than One is a multidimensional array. 2D array is also a multidimensional array.

E.g. of 3D array

    int a[3][2][4];

Here, the first subscript specifies a plane number, the second subscript a row number and the third a column number.

DIFFERENCE :

 Every 2D array is a multidimensional array but the other way round is not necessary(for example a 3D array is also a multidimensional array but its surely not 2D).