The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees--History of Combinatorial Generation (Art of Computer Programming)
A loop-free two-close Gray-code algorithm for listing k-ary Dyck words
Journal of Discrete Algorithms
Generating balanced parentheses and binary trees by prefix shifts
CATS '08 Proceedings of the fourteenth symposium on Computing: the Australasian theory - Volume 77
Binary bubble languages and cool-lex order
Journal of Combinatorial Theory Series A
Cool-lex order and k-ary Catalan structures
Journal of Discrete Algorithms
Hi-index | 0.00 |
A binary string B of length n=kt is a k-ary Dyck word if it contains t copies of 1, and the number of 0s in every prefix of B is at most k−1 times the number of 1s. We provide two loopless algorithms for generating k-ary Dyck words in cool-lex order: (1) The first requires two index variables and assumes k is a constant; (2) The second requires t index variables and works for any k. We also efficiently rank k-ary Dyck words in cool-lex order. Our results generalize the “coolCat” algorithm by Ruskey and Williams (Generating balanced parentheses and binary trees by prefix shifts in CATS 2008) and provide the first loopless and ranking applications of the general cool-lex Gray code by Ruskey, Sawada, and Williams (Binary bubble languages and cool-lex order under review).