Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: optimize th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 45809 of 47034
Post > Topic >>

Re: optimize this ****fting code ?

by lunar_lty <penglu96@[EMAIL PROTECTED] > May 8, 2008 at 05:56 AM

> 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
 




 6 Posts in Topic:
optimize this Shifting code ?
Matthias Pospiech <mat  2008-05-08 14:23:56 
Re: optimize this Shifting code ?
lunar_lty <penglu96@[E  2008-05-08 05:56:56 
Re: optimize this Shifting code ?
"Victor Bazarov"  2008-05-08 20:53:03 
Re: optimize this Shifting code ?
Jerry Coffin <jcoffin@  2008-05-08 19:07:22 
Re: optimize this Shifting code ?
"Steven G. Johnson&q  2008-05-08 21:45:11 
Re: optimize this Shifting code ?
Jerry Coffin <jcoffin@  2008-05-09 07:54:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:08:02 CDT 2008.