Generating 2-Gray codes for ballot sequences in constant amortized time

Dennis Wong, Fabio Calero, Kushal Sedhai

Research output: Contribution to journalArticlepeer-review

2 Citations (Scopus)

Abstract

We present a simple algorithm that generates a cyclic 2-Gray code for ballot sequences. The algorithm generates each ballot sequence in constant amortized time using a linear amount of space. This is the first known cyclic 2-Gray code for ballot sequences that achieves this time bound. In addition, the algorithm can be easily modified to output ballot sequences in binary reflected Gray code order in constant amortized time per string using a linear amount of space.

Original languageEnglish
Article number113168
JournalDiscrete Mathematics
Volume346
Issue number1
DOIs
Publication statusPublished - Jan 2023

Keywords

  • Ballot sequence
  • Binary reflected Gray code
  • CAT algorithm
  • Dyck words
  • Flip-swap language
  • Gray code

Fingerprint

Dive into the research topics of 'Generating 2-Gray codes for ballot sequences in constant amortized time'. Together they form a unique fingerprint.

Cite this