purpose of Three Dimensional Array, And how does it look like | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

purpose of Three Dimensional Array, And how does it look like

Can anyone please explain what is a three dimensional array, how does it look like, where do we use them? For what I know is that two dimensional arrays are used in matrix multiplication, add, sub etc.

23rd Jun 2017, 8:13 AM
Ponie Yumnam
Ponie Yumnam - avatar
4 Answers
+ 8
As @Kinshuk said, it can be visualised as a cube, or a graph with 3 axis. That, or you can also think of multidimensional arrays as boxes containing boxes. E.g. int array[3][2]; will declare three large boxes, and each box contains two smaller boxes. int array[2][2][2]; will declare two large boxes, each containing two smaller boxes. In the smaller boxes, each contains another two smaller boxes, etc.
23rd Jun 2017, 9:05 AM
Hatsy Rei
Hatsy Rei - avatar
23rd Jun 2017, 8:20 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 4
It can be used to represent a cube ( mathematics or something like rubik's ) , a collection of matrices or a 3D world space for a game ( each element as a coordinate )...
23rd Jun 2017, 8:22 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
@Hatsy Rei Something like Matryoshka Dolls, right?
23rd Jun 2017, 9:26 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar