We don't bite newbies here... much | |
PerlMonks |
Re^2: [OT] Swapping buffers in place.by BrowserUk (Patriarch) |
on Mar 01, 2015 at 06:42 UTC ( [id://1118232]=note: print w/replies, xml ) | Need Help?? |
I can do it with just one temp and n+m+(m-n) swaps (on paper):
But I'm damned if I can see any pattern to the increments & decrements or steps; to capture that for a generic M+N? the triple reverse (which really is only two passes through the whole thing). That's really quite brilliant, I'd never have thought of that :), and it will certainly be what O shall fall back to if I can't get this working. But as the left buffers are going to be 2GB or 4GB or 8GB or 16GB or 32GB (depending on physical memory in the machine) and the right buffer could be anything from 16 bytes up to the (leftBufferSize)-16 (ie. whatever is left in the dataset modulus the leftBufferSize) you can see why I'd rather avoid (M+N)*2 if I can get M+N+(M-N). (And also why a 3 buffer is impractical.) 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
In Section
Seekers of Perl Wisdom
|
|