How can I correctly display my AVL Tree in LaTex? A solo left-child hangs straight down....

Posted by cb on Stack Overflow See other posts from Stack Overflow or by cb
Published on 2010-03-16T13:13:07Z Indexed on 2010/03/16 13:16 UTC
Read the original article Hit count: 214

Filed under:
|
|

The below code almost works perfectly, however the child of 9, 7, hangs straight down instead of as a left-child. How can I correct this?

\usepackage{tikz}
\usepackage{xytree}
\begin{tikzpicture}[level/.style={sibling distance=60mm/#1}]
    \node [circle,draw] {4}
      child {
        node [circle,draw] {2}
            child {node [circle,draw] {1}
       }
        child {
            node [circle,draw]{3}
        }
      }
      child {node [circle,draw] {6}
        child {node [circle,draw]  {5}
        }
      child {node [circle,draw]  {9}
        child {node [circle, draw]  {7}}
      }
    };

\end{tikzpicture}}

Thanks, CB

© Stack Overflow or respective owner

Related posts about latex

Related posts about xypic