> The following code does this, but I wonder if there are possibilites to
> optimize it? It is very generall, but the ****fting with the delimiter in
> the middle is the only one that I need.
>
> // *********************************
> // Cycle changes 012 345 to 345 012
> // *********************************
As you said, the ****fting with the delimiter in the middle is the one
you need.
That means you only need to do is to swap them.
Ex: the original Cycle: 012 345 .
Now swap(0,3),(1,4), (2,5), result is Cycle: 345 012


|