On Generating B-Trees with Constant Average Delay and in Lexicographic Order

Abstract Gupta, Lee and Wong described algorithms for generating 2–3 trees and B-trees and left as open problems whether algorithms exist that generate them in lexicographic order, and whether it is possible to generate 2–3 trees or B-trees in constant average delay, exclusive of the output. In this note we modify the B-tree representation and show that the order of generating 2–3 trees and B-trees in their paper islexicographic under the new representation. We also prove that their algorithm for generating B-trees has a constant average delay property. This is the first algorithm for which such a property is proved, showing that B-trees can be generated with constant average delay.

[1]  Pierre Kelsen Ranking and Unranking Trees Using Regular Reductions , 1996, STACS.

[2]  Dominique Roelants van Baronaigien A Loopless Algorithm for Generating Binary Tree Sequences , 1991, Inf. Process. Lett..

[3]  Frank Ruskey,et al.  Generating Binary Trees Lexicographically , 1977, SIAM J. Comput..

[4]  Liwu Li Ranking and Unranking of AVL-Trees , 1986, SIAM J. Comput..

[5]  M. C. Er A Simple Algorithm for Generating Non-Regular Trees in Lexicographic Order , 1988, Comput. J..

[6]  S. G. Williamson,et al.  On the ordering, ranking, and random generation of basic combinatorial sets , 1977 .

[7]  Shmuel Zaks,et al.  Generation and Ranking of k-ary Trees , 1982, Inf. Process. Lett..

[8]  Frank Ruskey Generating t-ary Trees Lexicographically , 1978, SIAM J. Comput..

[9]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[10]  C. K. Wong,et al.  Ranking and Unranking of 2-3 Trees , 1982, SIAM J. Comput..

[11]  Sandra Mitchell Hedetniemi,et al.  Constant Time Generation of Rooted Trees , 1980, SIAM J. Comput..

[12]  Teruo Hikita Listing and Counting Subtrees of Equal Size of a Binary Tree , 1983, Inf. Process. Lett..

[13]  Jean Marcel Pallo,et al.  Generating trees with n nodes and m leaves , 1987 .

[14]  Wladyslaw Skarbek Generating Ordered Trees , 1988, Theor. Comput. Sci..

[15]  Chak-Kuen Wong,et al.  Ranking and Unranking of B-Trees , 1983, J. Algorithms.

[16]  Jean Marcel Pallo Lexicographic generation of binary unordered trees , 1989, Pattern Recognit. Lett..

[17]  Anthony E. Trojanowski Ranking and Listing Algorithms for k-ary Trees , 1978, SIAM J. Comput..

[18]  Brendan D. McKay,et al.  Constant Time Generation of Free Trees , 1986, SIAM J. Comput..