Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: [OT] Swapping buffers in place.

by BrowserUk (Patriarch)
on Mar 01, 2015 at 18:16 UTC ( [id://1118298]=note: print w/replies, xml ) Need Help??


in reply to Re: [OT] Swapping buffers in place.
in thread [OT] Swapping buffers in place.

Nice! Passes my basket case:

C:\test>1118262 3 swaps => 1 2 3 a b c 4 swaps => 1 2 a b c d 5 swaps => 1 a b c d e 16 swaps => 1 2 3 4 5 6 7 8 a b c d e f g h i j 6 swaps => 1 2 3 a b c d e f

I took out the shorter/longer tests as that's never going to be a requirement. (Cool that it doesn't matter to the algorithm though!)

It'll take me a while to wrap my brain around it -- recursion always does -- but so far it ticks all the boxes. Thank you.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1118298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-18 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found