I have an array such as
I want to rotate it N places to the right; for example, if N=3, the array should end
Assume that the only available operation is a FLIP method that can invert any portion of the array. For example, applied to the original array FLIP(3,6) would produce A-B-F-E-D-C-G-H-I-J-K.
(In reply to 10 step method
by logischer Verstand)
This method uses a SWAP, though calling it a FLIP. FLIP (1,9) does not just swap the 1st and the 9th, but reverses the whole set of 1 - 9.
Posted by Charlie
on 2004-04-19 23:24:52