I have this array:
int[][][] D = new int[N][M][2];
My question is: how can I swap D[N][M][0] and D[N][M][1] (it is NOT swap two elements, but swap whole array). It maybe seems silly, but I cannot imagine how 3-dimensional array organize, so I don't know which is the best method to copy it. Moreover, I don't sure does D[N][M][0] and D[N][M][1] is two block consecutive in memory ? If not, so I should do that:
int[][][] D = new int[2][N][M]
right ?
Thanks :)
[0]as it indicates a particular index of that final array. You want D[A][B] to be switched not an element within D[A][B].