Question: using c++ BST and Heap: Huffman coding and decoding Huffman Encoding is one of the simplest algorithms to compress data. Even though it is very
using c++
BST and Heap: Huffman coding and decoding
Huffman Encoding is one of the simplest algorithms to compress data. Even though it is very old and simple, it is still widely used (example: in few stages of JPEG, MPEG etc.)
In this project you will implement Huffman Encoding and Decoding. You can read about it in the textbook, Wikipedia or any other tutorial.
Your system must accept a file and you need to form a binary (Huffman) tree for the same. During the construction of Huffman tree, use the priority queue to select nodes with smallest frequencies. Once you have constructed the tree, traverse the tree and create a dictionary of codewords (letter to code). Given any new sentences, your system must show how the sentence is converted to Huffman code and then decoded back to original sentence. Note that you must implement BST and Heap yourself and must not rely on any language libraries.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
