Oscar F
Oscar F

Reputation: 323

How do 3D arrays work?

I've used 2D arrays and I just view them as tables, I'm wondering as to how a 3D array works and how or when you would implement it into a program? Just curious. I should mention I'm using java.

Upvotes: 0

Views: 3264

Answers (1)

Craig
Craig

Reputation: 1390

Maybe this will help to conceptualize it:

  1. Index of elements in a row
  2. Row and Column of item in a table
  3. Layer, Row and Column in a cube
  4. Index of element in a row of cubes
  5. Row and Column of item in a table of cubes

enter image description here

This is only if you exist in 3 spatial dimensions; Live long our 4th dimensional overlords, they can go one step further without using cubes of cubes

Upvotes: 5

Related Questions