Rotation revisited: Another unidirectional algorithm -- Raymond Chen
Some time ago, we looked at how to swap two adjacent blocks of memory in constant extra space, and along the way explored how std::rotate accomplishes the same task. I later claimed that the random-access implementations in both libc++ and libstdc++ treat the operation as a permutation decomposed…
Sources
- T1Rotation revisited: Another unidirectional algorithm -- Raymond ChenLanguage blogs: Rust / Go / TypeScript / Swift / Kotlin / Java / .NET / Ruby / PHP / Elixir / ISO C++