# Generate trees based on number of nodes and children allowed [closed]

I am doing an experiment, and would like to generate images of Binary Trees and Exponential Trees using LaTeX.

The difference between these two structures is the number of children allowed per node at each level. Binary Trees have a maximum of two, whereas Exponential Trees have 2dimension (with root being dimension = 1).

How would I be able to generate these trees using loops, so I could use a slightly modified Binary Tree TeX to generate the Exponential Tree?

-

## closed as not a real question by Joseph Wright♦Jul 7 '12 at 21:13

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

You have a few options such as the `tree` library of TikZ, or Tikz-qtree but the question is not clear. Without your code it's not likely to get an answer to your question as it is. – percusse Apr 22 '12 at 10:23
A binary tree with 32 nodes will be 6 dimensions long (1 node away from 5 dimensions). An exponential tree with 32 nodes will be 4 dimensions long. Here is a list showing differences: `d1:{1,1}, d2:{2,2}, d3:{4,8}, d4:{8,64}` – A T Apr 22 '12 at 10:30
So you want to just give the dimension number and get the tree automatically? An example would really clarify your goal with a Minimum Working Example. – percusse Apr 22 '12 at 12:17
There was a question about automatically generating binary trees a while back: tex.stackexchange.com/q/6258/86 Do any of the answers there look useful? – Loop Space Apr 22 '12 at 16:39