Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I conceptualize an array with more than three dimensions?

Tags:

c++

arrays

I just learned about arrays but can't conceptualize arrays with more than three dimensions.

like image 539
Justin Stryker Avatar asked Nov 27 '22 22:11

Justin Stryker


2 Answers

Imagine the following:

  • Letters on the line of a book
  • Lines on a page of a book
  • Pages of the book
  • Books in a bookshelf
  • A room full of bookshelves
  • House full of rooms
  • A street with a number of houses
  • A town with streets
  • A Country with towns
  • A planet with countries
  • A universe full of planets
  • And finally, a big array of universes.

Viola, a 12 dimensional array.

like image 69
Lindydancer Avatar answered Dec 20 '22 07:12

Lindydancer


Imagine a series of 3-dimensional cubes, one after another.

You can also think of it as a single 3D cube evolving over discrete intervals of time.

I find these helpful if you want a mental model that fits into the usual spatial (plus time) system, i.e. something whose dimensions you can visualize all at once in the physical world.

like image 33
Cameron Avatar answered Dec 20 '22 08:12

Cameron