Comment on Swapping two blocks of memory inside a larger block, in constant memoryparentComments−HarHarVeryFunny8moIsn't he also using 2N operations?To swap B and D, with intervening C (i.e. B C D), what he his doing is individually reversing each of B C, and D (= total N swaps), then reversing the combined B' C' D' (= another N swaps).
Comments
Isn't he also using 2N operations?
To swap B and D, with intervening C (i.e. B C D), what he his doing is individually reversing each of B C, and D (= total N swaps), then reversing the combined B' C' D' (= another N swaps).