计算机科学 > 数据结构与算法
[提交于 2024年11月11日]
标题:Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:We first present a simple recursive algorithm that generates cyclic rotation Gray codes for stamp foldings and semi-meanders, where consecutive strings differ by a stamp rotation. These are the first known Gray codes for stamp foldings and semi-meanders, and we thus solve an open problem posted by Sawada and Li in [Electron. J. Comb. 19(2), 2012]. We then introduce an iterative algorithm that generates the same rotation Gray codes for stamp foldings and semi-meanders. Both the recursive and iterative algorithms generate stamp foldings and semi-meanders in constant amortized time and $O(n)$-amortized time per string respectively, using a linear amount of memory.
提交历史
来自:Bowie Liu[v1] 2024年11月11日 星期一 00:00:00 UTC