, Volume 30, Issue 1, pp 17-26

Generating alternating permutations lexicographically

Rent the article at a discount

Rent now

* Final gross prices may vary according to local VAT.

Get Access


A permutation π1 π2 ... π n is alternating if π1234 .... We present a constant average-time algorithm for generating all alternating permutations in lexicographic order. Ranking and unranking algorithms are also derived.