, 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

Abstract

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.

Research supported by the Natural Sciences and Engineering Research Council of Canada under grant A3379.