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