What defines the dimensionality of an Array?

Technology CommunityCategory: ArraysWhat defines the dimensionality of an Array?
VietMX Staff asked 3 years ago

In programming, when you have a collection of similar items, each with an item number, the collection is called an array, and the item number is called a subscript. The dimensionality of an entire array is the number of subscripts you need to give in order to address a single element.

In ruby (for example) this is represented by::

[n] # One Dimension
[n][o] # Two Dimensions
[n][o][p] # Three Dimensions
[n][o][p][q] # Four Dimensions