生成邮票折叠和半蜿蜒的旋转格雷码的递归与迭代方法
Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders
AI总结:
本文提出递归与迭代算法,生成邮票折叠和半蜿蜒的循环旋转格雷码,解决开放问题,分别以常数和O(n)摊还时间运行。
摘要:
我们首先提出一个简单的递归算法,用于生成邮票折叠和半蜿蜒的循环旋转格雷码,其中连续字符串通过一次邮票旋转而不同。这些是已知的首个针对邮票折叠和半蜿蜒的格雷码,因此我们解决了Sawada和Li在[Electron. J. Comb. 19(2), 2012]中提出的一个开放问题。接着,我们引入一个迭代算法,生成相同的针对邮票折叠和半蜿蜒的旋转格雷码。递归和迭代算法分别以常数摊还时间和每字符串$O(n)$-摊还时间生成邮票折叠和半蜿蜒,使用线性内存。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。