Could someone please provide a reference giving an algorithm to generate uniformly random binary trees?
Tell me more
×
Computer Science Stack Exchange is a question and answer site for
students, researchers and practitioners of computer science. It's 100% free, no registration required.
|
There is a article available here and survey available here But desipte that its very easy to generate such tree, it all depends on random generator, it must be uniform. There are two simple approaches:
Both of them are guarantee to end, fist one is obvious, second one needs some induction proof which is quite simple to do. Taking into account Juho's hint take a look at Boltzmann sampling, it is indeed a powerfull tool which you can use. And here's a working example. |
|||||
|