Saved in:
Bibliographic Details
Main Authors: Liu, Bowie, Wong, Dennis, Lam, Chan-Tong, Im, Marcus
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2411.05458
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913574375391232
author Liu, Bowie
Wong, Dennis
Lam, Chan-Tong
Im, Marcus
author_facet Liu, Bowie
Wong, Dennis
Lam, Chan-Tong
Im, Marcus
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2411_05458
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders
Liu, Bowie
Wong, Dennis
Lam, Chan-Tong
Im, Marcus
Data Structures and Algorithms
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.
title Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders
topic Data Structures and Algorithms
url https://arxiv.org/abs/2411.05458