Cool-lex order and k-ary Catalan structures

被引:6
作者
Durocher, Stephane [1 ]
Li, Pak Ching [1 ]
Mondal, Debajyoti [1 ]
Ruskey, Frank [2 ]
Williams, Aaron [3 ]
机构
[1] Univ Manitoba, Dept Comp Sci, Winnipeg, MB, Canada
[2] Univ Victoria, Dept Comp Sci, Victoria, BC, Canada
[3] McGill Univ, Dept Math & Stat, Montreal, PQ, Canada
关键词
Catalan structures; Cool-lex order; Bubble langauges; Loopless algorithms; Ranking; k-ary Dyck words; k-ary trees;
D O I
10.1016/j.jda.2012.04.015
中图分类号
O29 [应用数学];
学科分类号
070104 ;
摘要
For any given k, the sequence of k-ary Catalan numbers, C-t,C-k = (Sic), enumerates a number of combinatorial objects, including k-ary Dyck words of length n = kt and k-ary trees with t internal nodes. We show that these objects can be efficiently ordered using the same variation of lexicographic order known as cool-lex order. In particular, we provide loopless algorithms that generate each successive object in O(1) time. The algorithms are also efficient in terms of memory, with the k-ary Dyck word algorithm using O(1) additional index variables, and the k-ary tree algorithm using O(t) additional pointers and index variables. We also show how to efficiently rank and unrank k-ary Dyck words in cool- lex order using O(kt) arithmetic operations, subject to an initial precomputation. Our results are based on the cool-lex successor rule for sets of binary strings that are bubble languages. However, we must complement and reverse 1/k-ary Dyck words to obtain the stated efficiency. (C) 2012 Elsevier B.V. All rights reserved.
引用
收藏
页码:287 / 307
页数:21
相关论文
共 32 条
[1]   Ranking and unranking algorithms for loopless generation of t-ary trees [J].
Ahmadi-Adl, Amin ;
Nowzari-Dalini, Abbas ;
Ahrabian, Hayedeh .
LOGIC JOURNAL OF THE IGPL, 2011, 19 (01) :33-43
[2]   Generation of t-ary trees with Ballot-sequences [J].
Ahrabian, H ;
Nowzari-Dalini, A .
INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 2003, 80 (10) :1243-1249
[3]   LOOPLESS ALGORITHMS FOR GENERATING PERMUTATIONS, COMBINATIONS, AND OTHER COMBINATORIAL CONFIGURATIONS [J].
EHRLICH, G .
JOURNAL OF THE ACM, 1973, 20 (03) :500-513
[4]  
Gray Frank, 1947, US Patent, Patent No. 2632058
[5]  
Heubach S., 2008, GARDEN K CATALAN STR
[6]   CATALAN NUMBERS, THEIR GENERALIZATION, AND THEIR USES [J].
HILTON, P ;
PEDERSEN, J .
MATHEMATICAL INTELLIGENCER, 1991, 13 (02) :64-75
[7]  
Johnson SM., 1963, MATH COMPUT, V17, P282
[8]  
Knuth DE, 2006, ART COMPUTER PROGRAM
[9]  
Knuth Donald E., 2010, ART COMPUTER PROGRAM, V4
[10]  
Kokosinski Z, 2004, LECT NOTES COMPUT SC, V3019, P255