title: how to determine a balanced or perfectly balanced Binary search tree ( just from the picture )
body: <p>I am not sure how to determine if a tree is balanced, perfectly balanced, or neither if I have it as a picture not a code</p>
  
  <p>For example if I have this tree
  How can I check if it's balanced, perfectly balanced, or unbalanced?
  and can someone give me an example of a perfectly balanced tree?</p>
  
  <pre><code>    [o]
     /   \
   [b]   [p]
     \    / \
    [d]  [m] [r]
  </code></pre>
  
  <p>Clearly I can tell that the tree is unbalanced if it was something like this:</p>
  
  <pre><code>      [b]
          \
          [d]
           \
            [r]
             \
             [c]
  </code></pre>
  
  <p>However, if it was something very similar to the one above I don't know how to get it</p>
  
  <p>This is a perfectly balanced and balanced tree:</p>
  
  <pre><code>        [k]
         /   \
        [A]   [p]
              /  \
             [N]  [R]
  </code></pre>
  
  <p>Can someone please explain it to me?</p>