Generating regular k-ary trees efficiently

被引:14
作者
Xiang, LM
Ushijima, K
Akl, SG
机构
[1] Kyushu Univ, Dept Comp Sci & Commun Engn, Higashi Ku, Fukuoka 8128581, Japan
[2] Queens Univ, Dept Comp & Informat Sci, Kingston, ON K7L 3N6, Canada
关键词
D O I
10.1093/comjnl/43.4.290
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
A recursive algorithm GenWordsR and a non-recursive algorithm GenWordsNR are presented in this paper to generate sequences for regular k-ary trees efficiently. They are compared with same of the previous recursive and non-recursive algorithms for this problem that were found in the literature. When the average number of recursive calls is used as a measure of the time complexity of recursive algorithms for generating k-ary trees, O(k) calls for a k-ary tree is the best result in the previous recursive algorithms, while O(1/k) calls for a k-ary tree is needed by GenWordsR. When the average number of comparisons is used as a measure of the time complexity of non-recursive algorithms for generating k-ary trees, GenWordsNR outperforms the previous non-recursive algorithms. As k increases, the number (and the average number) of comparisons performed by GenWordsNR tends to 66% that of the best previous non-recursive algorithms.
引用
收藏
页码:290 / 300
页数:11
相关论文
共 25 条
[1]  
Akl S. G., 1996, Nordic Journal of Computing, V3, P63
[2]   ENUMERATION OF BINARY-TREES [J].
BAPIRAJU, V ;
RAO, VV .
INFORMATION PROCESSING LETTERS, 1994, 51 (03) :125-127
[3]   ENUMERATING ORDERED TREES LEXICOGRAPHICALLY [J].
ER, MC .
COMPUTER JOURNAL, 1985, 28 (05) :538-542
[4]   EFFICIENT GENERATION OF K-ARY TREES IN NATURAL ORDER [J].
ER, MC .
COMPUTER JOURNAL, 1992, 35 (03) :306-308
[5]  
Hopcroft J.E., 1969, Formal Languages and Their Relation To Automata
[6]   Generating words lexicographically: An average-case analysis [J].
Kemp, R .
ACTA INFORMATICA, 1998, 35 (01) :17-89
[7]   NUMBERING SYSTEM FOR BINARY TREES [J].
KNOTT, GD .
COMMUNICATIONS OF THE ACM, 1977, 20 (02) :113-115
[8]  
Knuth DE, 1997, ART COMPUTER PROGRAM
[9]   Shifts and loopless generation of k-ary trees [J].
Korsh, JF ;
Lipschutz, S .
INFORMATION PROCESSING LETTERS, 1998, 65 (05) :235-240
[10]   LOOPLESS GENERATION OF K-ARY TREE SEQUENCES [J].
KORSH, JF .
INFORMATION PROCESSING LETTERS, 1994, 52 (05) :243-247