\documentclass{article}
\usepackage{trees}

\begin{document}

\tree{0}{
  \tree{1}{
    \leaf2
    \tree3{
      \leaf4
      \tree5{
        \leaf6
        \leaf7
        \tree8{
          \leaf9
          \leaf{10}
          \leaf{11}
          \leaf{12}
          \leaf{13}
       }}}
    \leaf{14}
    \leaf{15}
    \leaf{16}}
  \leaf{17}
  \tree{18}{
    \tree{19}{
      \leaf{20}
      \tree{21}{
        \leaf{22}
        \leaf{23}
        \leaf{24}}
      \leaf{25}
      \tree{26}{
        \tree{27}{
         \tree{28}{
           \leaf{29}
           \leaf{30}
           \leaf{31}
         }
         \leaf{32}
         \leaf{33}
         \tree{34}{
           \leaf{35}
           \leaf{36}
         }
      }}
      \leaf{37}}
    \leaf{38}
    \leaf{39}} 
  \leaf{40}  
  \leaf{41}
  \tree{42}{
    \tree{43}{
      \tree{44}{
        \leaf{45}
        \leaf{46}
        \tree{47}{
          \tree{48}{
            \leaf{49}
        }}
     }}
    \leaf{50}
   }}

\end{document}
