Cyclic permutation of elements in one-dimensional array | Applied Discrete Mathematics. Supplement. 2017. № 10. DOI: 10.17223/2226308X/10/57

Cyclic permutation of elements in one-dimensional array

In this paper, we obtain an expression for the smallest number J(N, K) of pairwise permutations of elements in an one-dimensional N-element array for resulting in the array being cyclically shifted k positions. An algorithm implementing this k-cyclic permutation is also constructed. For an arbitrary integer i, 0 ^ i < N, let ш (i) denote the smallest integer for which f(i) ^ i, where f (i) = i - k if i ^ k, and f (i) = = N (1 + [k/N])-k+i otherwise. Then the smallest number J(N, K) equals the cardinality of the set {i : N > i ^ 0 & g (i) > i}, where the map g : {0,..., N - 1} ^ {0,..., N - 1} is given by the rule g (i) = f(i) (0 ^ i < N).

Download file
Counter downloads: 173

Keywords

одномерный массив, k-циклическая перестановка, попарная перестановка элементов массива, one-dimensional array, k-cyclic permutation, pairwise permutation of array elements

Authors

NameOrganizationE-mail
Gotsulenko V. V.Institute of Engineering Thermophysics NAS of Ukrainegosul@ukr.net
Всего: 1

References

Бентли Дж. Жемчужины программирования. СПб.: Питер, 2002. 272 с.
Столяр С. Е. Массивы. СПб.: ЦПО «Информатизация образования», 2002. 39 с.
Kernighan В. and Plauger P. J. Software Tools in Pascal. Boston: Addison-Wesley, 1981.
Холл М. Теория групп. М.: ИЛ, 1962. 460 с.
 Cyclic permutation of elements in one-dimensional array | Applied Discrete Mathematics. Supplement. 2017. № 10. DOI: 10.17223/2226308X/10/57

Cyclic permutation of elements in one-dimensional array | Applied Discrete Mathematics. Supplement. 2017. № 10. DOI: 10.17223/2226308X/10/57