title: How to decode the message from a Huffman Encoded bit stream?
body: <p>How to decode the message from a Huffman Encoded bit stream?
  I am not clear about the idea of Huffman Algorithm.</p>
  
  <p>As far as I understand it, Suppose I am given a text message "My name is XYZ".</p>
  
  <p>Then the encoding process goes this way:
  1. Count the frequency of the characters.
  2. Sort the frequency by values.
  3. Construct a tree.
  4. Traverse the tree by considering left-edge as 0 and right-edge as 1 to get to the intended message character.
  5. Concatenate the codes to find the bit stream.</p>
  
  <p>Now the problem is, How can I find the original message from the encoded bit stream?</p>
  
  <p>I think we need to construct the Huffman tree again.</p>
  
  <p>But how can I construct the Huffman tree from the bit stream?</p>