|
ABSTRACT
Let B(N) denote the set of all binary trees that have N nodes. A procedure for randomly generating the trees in B(N) such that each tree is equally likely to occur, that is an unbiased random generator, is given which runs in O(N) time, requires very little storage, and uses a system of arithmetic no larger than is required to represent the number U itself. Previous unbiased random binary tree generators, based on inverse rank functions, ran in O(N log N) time and required multiple precision arithmetic capable of handling numbers of the order of magnitude of the cardinality of B(N).
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Beyer, Terry and Hedetniemi, Sandra Mitchell, Constant time generation of rooted trees, SlAM Journal on Computing, 9 (1980), 706-712.
|
| |
2
|
Er, M. C., A note on generating well-formed parenthesis strings lexicographically, The Computer Journal, 26 (1983), 205-207.
|
 |
3
|
|
| |
4
|
|
| |
5
|
Martin, H. W., Linear time recognition and transformation algorithms for binary tree representations, in preparation.
|
| |
6
|
Martin, H. W., Kiltinen, J. O. and McNeill, R. B., The representation and enumeration of ordered K-ary trees, submitted for publication.
|
| |
7
|
Pallo, J. M., Enumerating, ranking and unranking binary trees, The Computer Journal, 29 (1986), 171-175.
|
 |
8
|
|
 |
9
|
|
| |
10
|
Ruskey, F. and Hu, T. C., Generating binary trees lexicographically, SlAM Journal on Computing, 6 (1978), 745-758.
|
| |
11
|
|
 |
12
|
|
| |
13
|
Trojanowski, Anthony E., Ranking and listing algorithms for k-ary trees, SlAM Journal on Computing, 7 (1978), 492-509.
|
| |
14
|
Zaks, S., Lexicographic generation of ordered trees, Theoretical Computer Science, i0 (1980), 63-82.
|
|