We discuss a modification to the Gries-Mills block swapping scheme for in-place rotation with average costs of 1.85 moves per element and worst case performance still at 3 moves per element. Analysis of the average case relies on the asymptotic behavior of the sum of remainders in the Euclidean algorithm.
翻译:本文讨论了对Gries-Mills块交换方案的一种改进,该方案用于实现原地旋转,其平均成本为每个元素1.85次移动,最坏情况性能仍保持每个元素3次移动。平均情况的分析依赖于欧几里得算法中余数和的渐近行为。