[Tex/LaTex] How to make a 3 level deep tree with tikz

tikz-pgftrees

I am busy making a full binary tree of three levels deep.

The code I am having now is (using the trees library):

\begin{tikzpicture}
  \node {root}
    child {node {left}
      child {node {lleft}}
      child {node {rleft}}
    }
    child {node {right}
    child {node {lright}}
      child {node {rright}}
    };

\end{tikzpicture}

The problem is that rleft and rright are printed over each other.

Preferably I would like tikz to figure this out by itself, for example if I give a minimum distance between nodes on the same level. Is this possible? (My final nodes will not have text but will be fixed size shapes)

Off course it can be that the solution is: "Don't use 'trees'". In that case, what is the best way to do this?

Best Answer

tikz-qtree is an awesome package for more convenient tree drawing in tikz.

Related Question