ON ROTATIONS AND THE GENERATION OF BINARY-TREES

被引:73
作者
LUCAS, JM
VANBARONAIGIEN, DR
RUSKEY, F
机构
[1] RUTGERS UNIV,DEPT COMP SCI,NEW BRUNSWICK,NJ 08903
[2] UNIV VICTORIA,DEPT COMP SCI,VICTORIA V8W 2Y2,BC,CANADA
关键词
D O I
10.1006/jagm.1993.1045
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
The rotation graph, Gn, has vertex set consisting of all binary trees with n nodes. Two vertices are connected by an edge if a single rotation will transform one tree into the other. We provide a simpler proof of a result of Lucas that Gn, contains a Hamilton path. Our proof deals directly with the pointer representation of the binary tree. This proof provides the basis of an algorithm for generating all binary trees that can be implemented to run on a pointer machine and to use only constant time between the output of successive trees. Ranking and unranking algorithms are developed for the ordering of binary trees implied by the generation algorithm. These algorithms have time complexity O(n2) (arithmetic operations). We also show strong relationships amongst various representations of binary trees and amongst binary tree generation algorithms that have recently appeared in the literature. © 1993 Academic Press, Inc.
引用
收藏
页码:343 / 366
页数:24
相关论文
共 24 条
[1]  
BENT SW, 1991, LECT NOTES COMPUT SC, V447, P132
[2]  
COLE R, 1989, NYU471 DEP COMP SCI
[3]  
COLE R, 1989, NYU4470 DEPT COMP SC
[4]   COMBINATORIAL GRAY CODES [J].
JOICHI, JT ;
WHITE, DE ;
WILLIAMSON, SG .
SIAM JOURNAL ON COMPUTING, 1980, 9 (01) :130-141
[5]  
Knuth, 1997, SORTING SEARCHING
[6]  
Knuth D.E., 1973, FUNDAMENTAL ALGORITH
[7]  
LUCAS J, 1988, 234 RUTG U DEP COMP
[8]  
LUCAS JM, 1988, J ALGORITHM, V9, P503
[9]   LEFT DISTANCE BINARY-TREE REPRESENTATIONS [J].
MAKINEN, E .
BIT, 1987, 27 (02) :163-169
[10]  
Nijenhuis A., 1978, COMBINATORIAL ALGORI