Abstract

We present a recursive generating algorithm for unrestricted permutations which is based on both the decomposition of a permutation as a product of transpositions and that as a union of disjoint cycles. It generates permutations at each recursive step and slight modifications of it produce generating algorithms for Bell permutations and involutions. Further refinements yield algorithms for these classes of permutations subject to additional restrictions: a given number of cycles or/and fixed points. We obtain, as particular cases, generating algorithms for permutations counted by the Stirling numbers of the first and second kind, even permutations, fixed-point-free involutions and derangements. All of these algorithms run in constant amortized time.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call