Generating Ordered Trees
暂无分享,去创建一个
A new algorithm for generating all ordered trees on n nodes, is developed. It is a nonrecursive algorithm which, without any assistance of codewords or any other combinatorial representation, directly generated all trees on n nodes, in average time O(1) per tree. The algorithm transforms one tree into another in the following way: it finds a unique transforming node x and performs one node degradation operation, followed optionally by one path compression. The average length of path to be compressed is less than 1126. There is a coding of trees in which the algorithm produces trees in the lexicographic order.
[1] Gary D. Knott,et al. A numbering system for binary trees , 1977, CACM.
[2] Frank Ruskey,et al. Generating Binary Trees Lexicographically , 1977, SIAM J. Comput..
[3] Shmuel Zaks,et al. Lexicographic Generation of Ordered Trees , 1980, Theor. Comput. Sci..
[4] David Zerling,et al. Generating binary trees using rotations , 1985, JACM.
[5] Anthony E. Trojanowski. Ranking and Listing Algorithms for k-ary Trees , 1978, SIAM J. Comput..