计算机科学 > 数据结构与算法
[提交于 2024年4月16日]
标题:Generating a Gray code for prefix normal words in amortized polylogarithmic time per word
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:A prefix normal word is a binary word with the property that no substring has more $1$s 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 $n$ 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(\log^2 n)$ amortized time per word, while the best generation algorithm hitherto has $\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.
提交历史
来自:Gabriele Fici[v1] 2024年4月16日 星期二 00:00:00 UTC