GENERATING T-ARY TREES IN A-ORDER

被引:32
作者
VANBARONAIGIEN, DR
RUSKEY, F
机构
[1] Univ of Victoria, Victoria, BC, Can, Univ of Victoria, Victoria, BC, Can
关键词
COMPUTERS; DIGITAL - Computational Methods;
D O I
10.1016/0020-0190(88)90027-0
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Two 'natural' orders have been defined on the set of t-ary trees. Zaks referred to these orders as A-order and B-order. Many algorithms have been developed for generating binary and t-ary trees in B-order. Here we develop an algorithm for generating all t-ary trees with n nodes in (reverse) A-order, as well as ranking and unranking algorithms. The generation algorithm produces each tree in constant average time. The analysis of the generation algorithm makes use of an interesting bijection on the set of t-ary trees. The ranking algorithm runs in O(tn) time and the unranking algorithm in O(tn lag n) time.
引用
收藏
页码:205 / 213
页数:9
相关论文
共 6 条
[1]   NUMBERING SYSTEM FOR BINARY TREES [J].
KNOTT, GD .
COMMUNICATIONS OF THE ACM, 1977, 20 (02) :113-115
[2]  
Knuth D.E., 1973, FUNDAMENTAL ALGORITH
[3]   A NOTE ON GENERATING BINARY-TREES IN A-ORDER AND B-ORDER [J].
PALLO, J ;
RACCA, R .
INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 1985, 18 (01) :27-39
[4]   GENERATING T-ARY TREES LEXICOGRAPHICALLY [J].
RUSKEY, F .
SIAM JOURNAL ON COMPUTING, 1978, 7 (04) :424-439
[5]   NOTE ON ENUMERATING BINARY-TREES [J].
SOLOMON, M ;
FINKEL, RA .
JOURNAL OF THE ACM, 1980, 27 (01) :3-5
[6]   LEXICOGRAPHIC GENERATION OF ORDERED TREES [J].
ZAKS, S .
THEORETICAL COMPUTER SCIENCE, 1980, 10 (01) :63-82