Passing through a stack k times

Toufik Mansour, Howard Skogman, Rebecca Smith

Research output: Contribution to journalArticlepeer-review


We consider the number of passes a permutation needs to take through a stack if we only pop the appropriate output values and start over with the remaining entries in their original order. We define a permutation π to be k-pass sortable if π is sortable using k passes through the stack. Permutations that are 1-pass sortable are simply the stack sortable permutations as defined by Knuth. We define the permutation class of 2-pass sortable permutations in terms of their basis. We also show all k-pass sortable classes have finite bases by giving bounds on the length of a basis element of the permutation class for any positive integer k. Finally, we define the notion of tier of a permutation π to be the minimum number of passes after the first pass required to sort π. We then give a bijection between the class of permutations of tier t and a collection of integer sequences studied by Parker [The combinatorics of functional composition and inversion, PhD thesis, Brandeis University (1993)]. This gives an exact enumeration of tier t permutations of a given length and thus an exact enumeration for the class of (t + 1)-pass sortable permutations. Finally, we give a new derivation for the generating function in [S. Parker, The combinatorics of functional composition and inversion, PhD thesis, Brandeis University (1993)] and an explicit formula for the coefficients.

Original languageEnglish
Article number1950003
JournalDiscrete Mathematics, Algorithms and Applications
Issue number1
StatePublished - 1 Feb 2019

Bibliographical note

Publisher Copyright:
© 2019 World Scientific Publishing Company.


  • Data structure
  • covincular pattern
  • descent
  • integer sequence
  • packing density
  • permutation pattern
  • sorting
  • stack

ASJC Scopus subject areas

  • Discrete Mathematics and Combinatorics


Dive into the research topics of 'Passing through a stack k times'. Together they form a unique fingerprint.

Cite this