How to calculate the cycles that change one permutation into another?
I\'m looking for an algorithm th开发者_如何学JAVAat given two permutations of a sequence (e.g. [2, 3, 1, 4] and [4, 1, 3, 2]) calculates the cycles that are needed to convert the first into the second
问答
阅读(2)