English

Generating a Gray code for prefix normal words in amortized polylogarithmic time per word

Data Structures and Algorithms 2024-04-16 v2 Formal Languages and Automata Theory

Abstract

A prefix normal word is a binary word with the property that no substring has more 11s than the prefix of the same length. By proving that the set of prefix normal words is a bubble language, we can exhaustively list all prefix normal words of length nn as a combinatorial Gray code, where successive strings differ by at most two swaps or bit flips. This Gray code can be generated in \Oh(log2n)\Oh(\log^2 n) amortized time per word, while the best generation algorithm hitherto has \Oh(n)\Oh(n) running time per word. We also present a membership tester for prefix normal words, as well as a novel characterization of bubble languages.

Cite

@article{arxiv.2003.03222,
  title  = {Generating a Gray code for prefix normal words in amortized polylogarithmic time per word},
  author = {Péter Burcsi and Gabriele Fici and Zsuzsanna Lipták and Rajeev Raman and Joe Sawada},
  journal= {arXiv preprint arXiv:2003.03222},
  year   = {2024}
}

Comments

To appear in Theoretical Computer Science. arXiv admin note: text overlap with arXiv:1401.6346

R2 v1 2026-06-23T14:06:34.912Z