Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rotate an Array in Java

843789Aug 31 2010 — edited Aug 31 2010
I'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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2010
Added on Aug 31 2010
3 comments
127 views