title: Printing a binary tree in Java
body: <p>I'm trying to implement a Binary Tree, and for ease of debugging, I want to be able to print the tree so it actually looks like a tree. For example:</p>
  
  <pre><code>              50
        42              71
    31      45      60      98
  6    11 43  49  55
  </code></pre>
  
  <p>Or something similar. (The tree is always guaranteed to be complete.) I just need an algorithm or pseudocode to get me started. I just have no idea how implement something like this. Thanks for you help.</p>