clarification: when I say "graph", I mean the computer science term.
I want to draw a full binary tree of h
height. It means that there's one root with two sons, each son has two sons and so forth.
Is there a way to make LaTeX (with tikZ for example, but any other way will do) draw a full binary tree of a given h
height without manually drawing each node? This should also allow me to write on the edges and on the leaves.
Thanks.
Best Answer
Here's an admittedly hackish solution I just whipped up using TikZ:
You'll have to tweak it a bit to get the desired spacing between nodes.
Just stick that code that the top of your document (or in a new
.sty
). Then you can use it like this:The edges and leaves are indexed according to their order in the tree's associated Ahnentafel list. The result should look like this: