Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.stat.math.independent

Topic: Generation of random binary trees
Replies: 10   Last Post: Mar 20, 2014 10:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ] Topics: [ Previous | Next ]
Joe keane

Posts: 15
Registered: 11/12/11
Re: Generation of random binary trees
Posted: Mar 1, 2014 6:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <lelj4l$2s7$1@news.albasani.net>,
Mok-Kong Shen <mok-kong.shen@t-online.de> wrote:
>Given n, I want to randomly generate a binary tree (unlabelled) that
>has n end nodes. Could someone kindly provide a reference containing
>an algorithm for doing that?

They are counted by Catalan numbers.

At worst you can generate some random strings like "()(())" and throw
out the ones that are illegal.

There's probably a better way.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.