I was instructed not to use a storage array to complete this task. Basically, we have to create a function that rotates the contents of a 2d array 90 degrees.
So if I start off with this array:
int[][] array = {{1,2,3}, {4,5,6}, {7,8,9}};
The function should return an array like this:
{{7,4,1}, {8,5,2}, {9,6,3}}
Again we are not allowed to use a created array within the function for storage.
Is it even possible to accomplish this without a storage array?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…