+ 1
How do we even imagine a multidimensional array with more than three dimensions, can anyone give me an example of such
4 odpowiedzi
+ 9
Suppose a fly is moving in a 3 dimensional axes. And, we have to record its speed with respect to position and time. Now, the array becomes array[time][x][y][z], which has 4 dimensions. My example may be a little illogical but you get the concept, right?
+ 6
array = [1,2,[3,4,["hello"]]]
+ 1
Think of a tree. Like a family Heritage tree. If your array contains this: [4][3] then imagine a tree starting from four points. each oth the four points branch out in three. To know how many possible inputs there are, multiply 4 by 3. There are 12 possible inputs. After that, you can do any array. Just draw it out as trees branching down for each spot. A [7][4][9] array will start with 7 points. Each will branch into 4, and those branches will each branch into 9. This gives 252 inputs.
0
Thank you Rain and Krishna. I got it now thanks to your examples and a little more digging.