vendredi 28 décembre 2018

How can i generate random binary trees? (Python/JS)

How can i generate random binary trees with a format like this?

CA
AD
AB
CF
FH
HI
IF
HG

Representation of the tree above

Trees can be unordered and unbalanced.
A tree should not have more than 9 node but it can have less.
The depth of trees can be whatever.
I would prefer using Python or Javascript.

Thank you.




Aucun commentaire:

Enregistrer un commentaire