Write a C++ program that does the following: 1- reads a text paragraph (You could save it
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a C++ program that does the following:
1- reads a text paragraph (You could save it in a string) from the keyboard.
2- Counts the occurrences for each character that appears in the paragraph (You could save data in an array).
3- Computes the binary code for each character using Huffman Coding Algorithm.
4- The program after that is able to read a string, and prints out the binary code of it according to the Hufman code generated in point 3 (The program also prints out the number of total bits needed to encode the paragraph).
5- The program is able to read a sequence of binary code and prints out the corresponding characters also according to point 3 above.
Related Book For
Posted Date: