In his theory Claude Shannon described a way we could encode most of our information in a manner such that it could be expressed in the least amount of information. However finding the optimal scheme is still just a theoretical dream yet, but there has been considerable effort in developing ways to encode information in a way to match the Shannon limit. Huffman encoding is one such brilliant scheme to encode any piece of text into strings of binary digits, by using the relative frequency of each symbol in the text in a manner that uses the least size of binary strings and is finitely decodable.