Rotate an Array in Java
843789Aug 31 2010 — edited Aug 31 2010I'm sorry, can anybody help me to find out the algorithm of this one by using while loops?
The array has 7 elements int number[7]={0,1,2,3,4,5,6}
Rotate the numbers in the array. The first number becomes the second and
the second number becomes the third, ..., and the last number becomes the
first.
e.g. 0 1 2 3 4 5 6 => 6 0 1 2 3 4 5