Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-Dimensional Arrays

Tags:

java

arrays

I am working in Java and am wondering, are multi-dimensional arrays like grids where rows are elements and columns are dimensions, or are they hyper-geometric figures that we can't see?

like image 928
Joseph Burley Avatar asked Sep 26 '26 05:09

Joseph Burley


2 Answers

A 1D array is like a list, a 2D array is like a table with columns and rows, a 3D array is like a cube, x, y and z and anything more than that would be hyper-geometric. You could represent a cube with time with a 4D array.

like image 112
Ryan Guill Avatar answered Sep 28 '26 19:09

Ryan Guill


Sometimes it's useful to think of multidimensional arrays as geometric: lists, tables, cubes. Other times, such as when the arrays aren't of equal length, it's not. They might be:

  • lists of tables
  • lists of lists of lists
  • tables of cubes

At some (early) point it's time to make some classes.

like image 26
Michael Brewer-Davis Avatar answered Sep 28 '26 17:09

Michael Brewer-Davis