Part I Computer Science

BIT Numerical Mathematics

, Volume 30, Issue 1, pp 17-26

Generating alternating permutations lexicographically

  • Bruce BauslaughAffiliated withDepartment of Computer Science, University of VictoriaDept. of Mathematics, Simon Fraser University
  • , Frank RuskeyAffiliated withDepartment of Computer Science, University of Victoria

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.

CR Categories

F.2.2 G.2.1