简体   繁体   English

多维Arrays

[英]Multi-Dimensional 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?我在 Java 工作,我想知道,多维 arrays 是像网格一样,行是元素,列是维度,还是我们看不到的超几何图形?

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.一维数组就像一个列表,一个二维数组就像一个有列和行的表格,一个 3D 数组就像一个立方体,x、y 和 z 以及除此之外的任何东西都是超几何的。 You could represent a cube with time with a 4D array.您可以用 4D 数组表示一个带时间的立方体。

Sometimes it's useful to think of multidimensional arrays as geometric: lists, tables, cubes.有时将多维 arrays 视为几何图形是有用的:列表、表格、立方体。 Other times, such as when the arrays aren't of equal length, it's not.其他时候,例如当 arrays 长度不相等时,它不是。 They might be:他们可能是:

  • lists of tables表格列表
  • lists of lists of lists列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表列表
  • tables of cubes立方体表

At some (early) point it's time to make some class es.在某些(早期)时候,是时候制作一些class es了。

Depends on how many dimensions you create the array with.取决于您创建数组的维度。 Obviously you can create a 2 dimensional array that is a table.显然,您可以创建一个二维数组,即表格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM