摘要
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 (2012) [17]. 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.
原文 | English |
---|---|
文章編號 | 115053 |
期刊 | Theoretical Computer Science |
卷 | 1031 |
DOIs | |
出版狀態 | Published - 21 3月 2025 |