{"id":25056,"date":"2017-05-27T18:37:10","date_gmt":"2017-05-27T13:07:10","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=25056"},"modified":"2017-05-27T18:37:10","modified_gmt":"2017-05-27T13:07:10","slug":"huffman-coding","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/huffman-coding\/","title":{"rendered":"Huffman Coding"},"content":{"rendered":"<p>Huffman coding is a lossless data compression algorithm. The idea is to assign variable-legth codes to input characters, lengths of the assigned codes are based on the frequencies of corresponding characters.<span id=\"more-26851\"><\/span> The most frequent character gets the smallest code and the least frequent character gets the largest code.<\/p>\n<p>The variable-length codes assigned to input characters are <a href=\"https:\/\/www.wikitechy.com\/technology\/activity-selection-problem\/\">Prefix Codes<\/a>, means the codes (bit sequences) are assigned in such a way that the code assigned to one character is not prefix of code assigned to any other character. This is how Huffman Coding makes sure that there is no ambiguity when decoding the generated bit stream.<\/p>\n<p>Let us understand prefix codes with a counter example. Let there be four characters a, b, c and d, and their corresponding variable length codes be 00, 01, 0 and 1. This coding leads to ambiguity because code assigned to c is prefix of codes assigned to a and b. If the compressed bit stream is 0001, the de-compressed output may be \u201ccccd\u201d or \u201cccb\u201d or \u201cacd\u201d or \u201cab\u201d.<\/p>\n<p>See this for applications of Huffman Coding.<\/p>\n<p>There are mainly two major parts in Huffman Coding<\/p>\n<ol>\n<li>Build a Huffman Tree from input characters.<\/li>\n<li>Traverse the Huffman Tree and assign codes to characters.<\/li>\n<\/ol>\n[ad type=&#8221;banner&#8221;]\n<h4 id=\"steps-to-build-huffman-treeinput-is-array-of-unique-characters-along-with-their-frequency-of-occurrences-and-output-is-huffman-tree\"><strong>Steps to build Huffman Tree<\/strong><br \/>\nInput is array of unique characters along with their frequency of occurrences and output is Huffman Tree.<\/h4>\n<p><strong>1.<\/strong> Create a leaf node for each unique character and build a min heap of all leaf nodes (Min Heap is used as a priority queue. The value of frequency field is used to compare two nodes in min heap. Initially, the least frequent character is at root)<\/p>\n<p><strong>2.<\/strong> Extract two nodes with the minimum frequency from the min heap.<\/p>\n<p><strong>3.<\/strong> Create a new internal node with frequency equal to the sum of the two nodes frequencies. Make the first extracted node as its left child and the other extracted node as its right child. Add this node to the min heap.<\/p>\n<p><strong>4.<\/strong> Repeat steps#2 and #3 until the heap contains only one node. The remaining node is the root node and the tree is complete.<\/p>\n<p>Let us understand the algorithm with an example:<\/p>\n<pre>character   Frequency\r\n    a\t        5\r\n    b           9\r\n    c           12\r\n    d           13\r\n    e           16\r\n    f           45<\/pre>\n<p><strong>Step 1.<\/strong> Build a min heap that contains 6 nodes where each node represents root of a tree with single node.<\/p>\n<p><strong>Step 2<\/strong> Extract two minimum frequency nodes from min heap. Add a new internal node with frequency 5 + 9 = 14.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-25078 size-full\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-1-1.png\" alt=\"Huffman Coding\" width=\"300\" height=\"129\" \/><br \/>\nNow min heap contains 5 nodes where 4 nodes are roots of trees with single element each, and one heap node is root of tree with 3 elements<\/p>\n[ad type=&#8221;banner&#8221;]\n<pre>character           Frequency\r\n       c               12\r\n       d               13\r\n Internal Node         14\r\n       e               16\r\n       f                45\r\n<\/pre>\n<p><strong>Step 3:<\/strong> Extract two minimum frequency nodes from heap. Add a new internal node with frequency 12 + 13 = 25<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-25068\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-2.png\" alt=\"Huffman Coding\" width=\"300\" height=\"132\" \/><\/p>\n<p>Now min heap contains 4 nodes where 2 nodes are roots of trees with single element each, and two heap nodes are root of tree with more than one nodes.<\/p>\n<pre>character           Frequency\r\nInternal Node          14\r\n       e               16\r\nInternal Node          25\r\n       f               45\r\n<\/pre>\n<p><strong>Step 4:<\/strong> Extract two minimum frequency nodes. Add a new internal node with frequency 14 + 16 = 30<br \/>\n<img decoding=\"async\" class=\"aligncenter size-full wp-image-25070\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-3.png\" alt=\"Huffman Coding\" width=\"300\" height=\"162\" \/><br \/>\nNow min heap contains 3 nodes.<\/p>\n<pre>character          Frequency\r\nInternal Node         25\r\nInternal Node         30\r\n      f               45<\/pre>\n<p><strong>Step 5:<\/strong> Extract two minimum frequency nodes. Add a new internal node with frequency 25 + 30 = 55<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25074\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-4.png\" alt=\"Huffman Coding\" width=\"300\" height=\"121\" \/><br \/>\nNow min heap contains 2 nodes.<\/p>\n<pre>character     Frequency\r\n       f         45\r\nInternal Node    55<\/pre>\n<p><strong>Step 6:<\/strong> Extract two minimum frequency nodes. Add a new internal node with frequency 45 + 55 = 100<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25073\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-5.png\" alt=\"Huffman Coding\" width=\"300\" height=\"167\" srcset=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-5.png 300w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-5-215x120.png 215w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\nNow min heap contains only one node.<\/p>\n<pre>character      Frequency\r\nInternal Node    100<\/pre>\n<p>Since the heap contains only one node, the algorithm stops here.<\/p>\n<p><strong>Steps to print codes from Huffman Tree:<\/strong><br \/>\nTraverse the tree formed starting from the root. Maintain an auxiliary array. While moving to the left child, write 0 to the array. While moving to the right child, write 1 to the array. Print the array when a leaf node is encountered.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25065\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-1.jpg\" alt=\"Huffman Coding\" width=\"300\" height=\"167\" srcset=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-1.jpg 300w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/Huffman-Coding-1-215x120.jpg 215w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>The codes are as follows:<\/p>\n<pre>character   code-word\r\n    f          0\r\n    c          100\r\n    d          101\r\n    a          1100\r\n    b          1101\r\n    e          111<\/pre>\n<h4 id=\"ad-typebanner\">[ad type=&#8221;banner&#8221;]<\/h4>\n<h4 id=\"c-programming\"><strong>C Programming<\/strong><\/h4>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">C<\/span> <\/div> <pre class=\"language-c code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-c code-embed-code\">\/\/ C program for Huffman Coding<br\/>#include &lt;stdio.h&gt;<br\/>#include &lt;stdlib.h&gt;<br\/> <br\/>\/\/ This constant can be avoided by explicitly calculating height of Huffman Tree<br\/>#define MAX_TREE_HT 100<br\/> <br\/>\/\/ A Huffman tree node<br\/>struct MinHeapNode<br\/>{<br\/>    char data;  \/\/ One of the input characters<br\/>    unsigned freq;  \/\/ Frequency of the character<br\/>    struct MinHeapNode *left, *right; \/\/ Left and right child of this node<br\/>};<br\/> <br\/>\/\/ A Min Heap:  Collection of min heap (or Hufmman tree) nodes<br\/>struct MinHeap<br\/>{<br\/>    unsigned size;    \/\/ Current size of min heap<br\/>    unsigned capacity;   \/\/ capacity of min heap<br\/>    struct MinHeapNode **array;  \/\/ Attay of minheap node pointers<br\/>};<br\/> <br\/>\/\/ A utility function allocate a new min heap node with given character<br\/>\/\/ and frequency of the character<br\/>struct MinHeapNode* newNode(char data, unsigned freq)<br\/>{<br\/>    struct MinHeapNode* temp =<br\/>          (struct MinHeapNode*) malloc(sizeof(struct MinHeapNode));<br\/>    temp-&gt;left = temp-&gt;right = NULL;<br\/>    temp-&gt;data = data;<br\/>    temp-&gt;freq = freq;<br\/>    return temp;<br\/>}<br\/> <br\/>\/\/ A utility function to create a min heap of given capacity<br\/>struct MinHeap* createMinHeap(unsigned capacity)<br\/>{<br\/>    struct MinHeap* minHeap =<br\/>         (struct MinHeap*) malloc(sizeof(struct MinHeap));<br\/>    minHeap-&gt;size = 0;  \/\/ current size is 0<br\/>    minHeap-&gt;capacity = capacity;<br\/>    minHeap-&gt;array =<br\/>     (struct MinHeapNode**)malloc(minHeap-&gt;capacity * sizeof(struct MinHeapNode*));<br\/>    return minHeap;<br\/>}<br\/> <br\/>\/\/ A utility function to swap two min heap nodes<br\/>void swapMinHeapNode(struct MinHeapNode** a, struct MinHeapNode** b)<br\/>{<br\/>    struct MinHeapNode* t = *a;<br\/>    *a = *b;<br\/>    *b = t;<br\/>}<br\/> <br\/>\/\/ The standard minHeapify function.<br\/>void minHeapify(struct MinHeap* minHeap, int idx)<br\/>{<br\/>    int smallest = idx;<br\/>    int left = 2 * idx + 1;<br\/>    int right = 2 * idx + 2;<br\/> <br\/>    if (left &lt; minHeap-&gt;size &amp;&amp;<br\/>        minHeap-&gt;array[left]-&gt;freq &lt; minHeap-&gt;array[smallest]-&gt;freq)<br\/>      smallest = left;<br\/> <br\/>    if (right &lt; minHeap-&gt;size &amp;&amp;<br\/>        minHeap-&gt;array[right]-&gt;freq &lt; minHeap-&gt;array[smallest]-&gt;freq)<br\/>      smallest = right;<br\/> <br\/>    if (smallest != idx)<br\/>    {<br\/>        swapMinHeapNode(&amp;minHeap-&gt;array[smallest], &amp;minHeap-&gt;array[idx]);<br\/>        minHeapify(minHeap, smallest);<br\/>    }<br\/>}<br\/> <br\/>\/\/ A utility function to check if size of heap is 1 or not<br\/>int isSizeOne(struct MinHeap* minHeap)<br\/>{<br\/>    return (minHeap-&gt;size == 1);<br\/>}<br\/> <br\/>\/\/ A standard function to extract minimum value node from heap<br\/>struct MinHeapNode* extractMin(struct MinHeap* minHeap)<br\/>{<br\/>    struct MinHeapNode* temp = minHeap-&gt;array[0];<br\/>    minHeap-&gt;array[0] = minHeap-&gt;array[minHeap-&gt;size - 1];<br\/>    --minHeap-&gt;size;<br\/>    minHeapify(minHeap, 0);<br\/>    return temp;<br\/>}<br\/> <br\/>\/\/ A utility function to insert a new node to Min Heap<br\/>void insertMinHeap(struct MinHeap* minHeap, struct MinHeapNode* minHeapNode)<br\/>{<br\/>    ++minHeap-&gt;size;<br\/>    int i = minHeap-&gt;size - 1;<br\/>    while (i &amp;&amp; minHeapNode-&gt;freq &lt; minHeap-&gt;array[(i - 1)\/2]-&gt;freq)<br\/>    {<br\/>        minHeap-&gt;array[i] = minHeap-&gt;array[(i - 1)\/2];<br\/>        i = (i - 1)\/2;<br\/>    }<br\/>    minHeap-&gt;array[i] = minHeapNode;<br\/>}<br\/> <br\/>\/\/ A standard funvtion to build min heap<br\/>void buildMinHeap(struct MinHeap* minHeap)<br\/>{<br\/>    int n = minHeap-&gt;size - 1;<br\/>    int i;<br\/>    for (i = (n - 1) \/ 2; i &gt;= 0; --i)<br\/>        minHeapify(minHeap, i);<br\/>}<br\/> <br\/>\/\/ A utility function to print an array of size n<br\/>void printArr(int arr[], int n)<br\/>{<br\/>    int i;<br\/>    for (i = 0; i &lt; n; ++i)<br\/>        printf(&quot;%d&quot;, arr[i]);<br\/>    printf(&quot;\\n&quot;);<br\/>}<br\/> <br\/>\/\/ Utility function to check if this node is leaf<br\/>int isLeaf(struct MinHeapNode* root)<br\/>{<br\/>    return !(root-&gt;left) &amp;&amp; !(root-&gt;right) ;<br\/>}<br\/> <br\/>\/\/ Creates a min heap of capacity equal to size and inserts all character of <br\/>\/\/ data[] in min heap. Initially size of min heap is equal to capacity<br\/>struct MinHeap* createAndBuildMinHeap(char data[], int freq[], int size)<br\/>{<br\/>    struct MinHeap* minHeap = createMinHeap(size);<br\/>    for (int i = 0; i &lt; size; ++i)<br\/>        minHeap-&gt;array[i] = newNode(data[i], freq[i]);<br\/>    minHeap-&gt;size = size;<br\/>    buildMinHeap(minHeap);<br\/>    return minHeap;<br\/>}<br\/> <br\/>\/\/ The main function that builds Huffman tree<br\/>struct MinHeapNode* buildHuffmanTree(char data[], int freq[], int size)<br\/>{<br\/>    struct MinHeapNode *left, *right, *top;<br\/> <br\/>    \/\/ Step 1: Create a min heap of capacity equal to size.  Initially, there are<br\/>    \/\/ modes equal to size.<br\/>    struct MinHeap* minHeap = createAndBuildMinHeap(data, freq, size);<br\/> <br\/>    \/\/ Iterate while size of heap doesn&#039;t become 1<br\/>    while (!isSizeOne(minHeap))<br\/>    {<br\/>        \/\/ Step 2: Extract the two minimum freq items from min heap<br\/>        left = extractMin(minHeap);<br\/>        right = extractMin(minHeap);<br\/> <br\/>        \/\/ Step 3:  Create a new internal node with frequency equal to the<br\/>        \/\/ sum of the two nodes frequencies. Make the two extracted node as<br\/>        \/\/ left and right children of this new node. Add this node to the min heap<br\/>        \/\/ &#039;$&#039; is a special value for internal nodes, not used<br\/>        top = newNode(&#039;$&#039;, left-&gt;freq + right-&gt;freq);<br\/>        top-&gt;left = left;<br\/>        top-&gt;right = right;<br\/>        insertMinHeap(minHeap, top);<br\/>    }<br\/> <br\/>    \/\/ Step 4: The remaining node is the root node and the tree is complete.<br\/>    return extractMin(minHeap);<br\/>}<br\/> <br\/>\/\/ Prints huffman codes from the root of Huffman Tree.  It uses arr[] to<br\/>\/\/ store codes<br\/>void printCodes(struct MinHeapNode* root, int arr[], int top)<br\/>{<br\/>    \/\/ Assign 0 to left edge and recur<br\/>    if (root-&gt;left)<br\/>    {<br\/>        arr[top] = 0;<br\/>        printCodes(root-&gt;left, arr, top + 1);<br\/>    }<br\/> <br\/>    \/\/ Assign 1 to right edge and recur<br\/>    if (root-&gt;right)<br\/>    {<br\/>        arr[top] = 1;<br\/>        printCodes(root-&gt;right, arr, top + 1);<br\/>    }<br\/> <br\/>    \/\/ If this is a leaf node, then it contains one of the input<br\/>    \/\/ characters, print the character and its code from arr[]<br\/>    if (isLeaf(root))<br\/>    {<br\/>        printf(&quot;%c: &quot;, root-&gt;data);<br\/>        printArr(arr, top);<br\/>    }<br\/>}<br\/> <br\/>\/\/ The main function that builds a Huffman Tree and print codes by traversing<br\/>\/\/ the built Huffman Tree<br\/>void HuffmanCodes(char data[], int freq[], int size)<br\/>{<br\/>   \/\/  Construct Huffman Tree<br\/>   struct MinHeapNode* root = buildHuffmanTree(data, freq, size);<br\/> <br\/>   \/\/ Print Huffman codes using the Huffman tree built above<br\/>   int arr[MAX_TREE_HT], top = 0;<br\/>   printCodes(root, arr, top);<br\/>}<br\/> <br\/>\/\/ Driver program to test above functions<br\/>int main()<br\/>{<br\/>    char arr[] = {&#039;a&#039;, &#039;b&#039;, &#039;c&#039;, &#039;d&#039;, &#039;e&#039;, &#039;f&#039;};<br\/>    int freq[] = {5, 9, 12, 13, 16, 45};<br\/>    int size = sizeof(arr)\/sizeof(arr[0]);<br\/>    HuffmanCodes(arr, freq, size);<br\/>    return 0;<br\/>}<\/code><\/pre> <\/div>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<div id=\"tablist1-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\">\n<h4 id=\"c-programming-2\" class=\"syntaxhighlighter nogutter c\"><strong>C++\u00a0<\/strong><strong>Programming<\/strong><\/h4>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-cpp code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-cpp code-embed-code\">\/\/ C++ program for Huffman Coding<br\/>#include &lt;bits\/stdc++.h&gt;<br\/>using namespace std;<br\/> <br\/>\/\/ A Huffman tree node<br\/>struct MinHeapNode<br\/>{<br\/>    char data;                \/\/ One of the input characters<br\/>    unsigned freq;             \/\/ Frequency of the character<br\/>    MinHeapNode *left, *right; \/\/ Left and right child<br\/> <br\/>    MinHeapNode(char data, unsigned freq)<br\/>    {<br\/>        left = right = NULL;<br\/>        this-&gt;data = data;<br\/>        this-&gt;freq = freq;<br\/>    }<br\/>};<br\/> <br\/>\/\/ For comparison of two heap nodes (needed in min heap)<br\/>struct compare<br\/>{<br\/>    bool operator()(MinHeapNode* l, MinHeapNode* r)<br\/>    {<br\/>        return (l-&gt;freq &gt; r-&gt;freq);<br\/>    }<br\/>};<br\/> <br\/>\/\/ Prints huffman codes from the root of Huffman Tree.<br\/>void printCodes(struct MinHeapNode* root, string str)<br\/>{<br\/>    if (!root)<br\/>        return;<br\/> <br\/>    if (root-&gt;data != &#039;$&#039;)<br\/>        cout &lt;&lt; root-&gt;data &lt;&lt; &quot;: &quot; &lt;&lt; str &lt;&lt; &quot;\\n&quot;;<br\/> <br\/>    printCodes(root-&gt;left, str + &quot;0&quot;);<br\/>    printCodes(root-&gt;right, str + &quot;1&quot;);<br\/>}<br\/> <br\/>\/\/ The main function that builds a Huffman Tree and<br\/>\/\/ print codes by traversing the built Huffman Tree<br\/>void HuffmanCodes(char data[], int freq[], int size)<br\/>{<br\/>    struct MinHeapNode *left, *right, *top;<br\/> <br\/>    \/\/ Create a min heap &amp; inserts all characters of data[]<br\/>    priority_queue&lt;MinHeapNode*, vector&lt;MinHeapNode*&gt;, compare&gt; minHeap;<br\/>    for (int i = 0; i &lt; size; ++i)<br\/>        minHeap.push(new MinHeapNode(data[i], freq[i]));<br\/> <br\/>    \/\/ Iterate while size of heap doesn&#039;t become 1<br\/>    while (minHeap.size() != 1)<br\/>    {<br\/>        \/\/ Extract the two minimum freq items from min heap<br\/>        left = minHeap.top();<br\/>        minHeap.pop();<br\/> <br\/>        right = minHeap.top();<br\/>        minHeap.pop();<br\/> <br\/>        \/\/ Create a new internal node with frequency equal to the<br\/>        \/\/ sum of the two nodes frequencies. Make the two extracted<br\/>        \/\/ node as left and right children of this new node. Add<br\/>        \/\/ this node to the min heap<br\/>        \/\/ &#039;$&#039; is a special value for internal nodes, not used<br\/>        top = new MinHeapNode(&#039;$&#039;, left-&gt;freq + right-&gt;freq);<br\/>        top-&gt;left = left;<br\/>        top-&gt;right = right;<br\/>        minHeap.push(top);<br\/>    }<br\/> <br\/>    \/\/ Print Huffman codes using the Huffman tree built above<br\/>    printCodes(minHeap.top(), &quot;&quot;);<br\/>}<br\/> <br\/>\/\/ Driver program to test above functions<br\/>int main()<br\/>{<br\/>    char arr[] = { &#039;a&#039;, &#039;b&#039;, &#039;c&#039;, &#039;d&#039;, &#039;e&#039;, &#039;f&#039; };<br\/>    int freq[] = { 5, 9, 12, 13, 16, 45 };<br\/>    int size = sizeof(arr) \/ sizeof(arr[0]);<br\/> <br\/>    HuffmanCodes(arr, freq, size);<br\/> <br\/>    return 0;<br\/>}<br\/>\/\/ This code is contributed by Aditya Goel<\/code><\/pre> <\/div>\n<p>&nbsp;<\/p>\n<pre>f: 0\r\nc: 100\r\nd: 101\r\na: 1100\r\nb: 1101\r\ne: 111<\/pre>\n<p><strong>Time complexity:<\/strong> O(nlogn) where n is the number of unique characters. If there are n nodes, extractMin() is called 2*(n \u2013 1) times. extractMin() takes O(logn) time as it calles minHeapify(). So, overall complexity is O(nlogn).<\/p>\n<p>If the input array is sorted, there exists a linear time algorithm. We will soon be discussing in our next post.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Huffman Coding &#8211; Greedy Algorithm &#8211; Huffman coding is a lossless data compression algorithm. The idea is to assign variable-legth codes to input characters.<\/p>\n","protected":false},"author":1,"featured_media":25368,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70144],"tags":[71082,71090,73006,71079,71063,73004,71083,71085,73009,73005,73007,71089,71100,71107,71086,73008,71080,71088,73010,71118,71115,71095,71087,71099,71106,71111,71073,71064,71102,71094],"class_list":["post-25056","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-greedy-algorithm","tag-application-of-huffman-coding-in-data-compression","tag-c-program-to-implement-huffman-code","tag-huffman-code-generator","tag-huffman-coding-algorithm-in-c","tag-huffman-coding-c-program","tag-huffman-coding-c","tag-huffman-coding-example","tag-huffman-coding-example-pdf","tag-huffman-coding-example-with-probabilities","tag-huffman-coding-in-c","tag-huffman-coding-java","tag-huffman-coding-program-in-c","tag-huffman-coding-program-in-c-with-output","tag-huffman-coding-program-in-java","tag-huffman-coding-steps","tag-huffman-coding-tutorial","tag-huffman-coding-with-example","tag-huffman-compression-algorithm","tag-huffman-decoding","tag-huffman-encoding-and-decoding-example-in-java","tag-huffman-encoding-tree","tag-huffman-program-in-c","tag-huffman-tree","tag-huffman-tree-c","tag-image-compression-using-huffman-coding-in-java","tag-simple-huffman-coding-c","tag-simple-huffman-coding-in-c","tag-source-code-for-huffman-coding-in-c","tag-write-a-program-for-huffman-coding","tag-write-a-program-for-huffman-coding-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=25056"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25056\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media\/25368"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=25056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=25056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=25056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}