title: How to draw a Huffman tree properly
body: <p>I have the following symbols and probabilities and I would like to draw a Huffman tree for them:</p>
  
  <pre><code>s = 0.04 || i = 0.1 || n = 0.2 || b = 0.04 || a = 0.3 || d = 0.26 || ~ = 0.06
  </code></pre>
  
  <p>Based on Huffman algorithm, I generated the following tree:</p>
  
  <p><a href="https://i.stack.imgur.com/pwCDO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pwCDO.png" alt="enter image description here"></a></p>
  
  <p>This was done by:</p>
  
  <ol>
  <li>Join <code>s + i</code></li>
  <li>Join the result of 1 and <code>n</code></li>
  <li>Join <code>~ + d</code></li>
  <li>Join <code>b + a</code></li>
  <li>Join the result of 3 and 4</li>
  <li>Join the result of 5 and 2</li>
  </ol>
  
  <p>My questions:
  is what I have done right or not? If so, is it acceptable that the final probability (result of 6) greater than 1?</p>
  
  <p>Thanks</p>