Click here to Skip to main content
15,616,746 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
To input a text file using path

compress the file using huffman algorithm
store it as a text file

decompress the file sing huffman algorithm
again store it as text file.

What I have tried:

Compression and decomression should be don filesize should be compressed
Posted
Updated 17-Apr-21 23:23pm

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
 
Share this answer
 
Quote:
How to compress and decompress the inputted file text using huffman coding in C++?

1) Learn C++.
2) Learn how to read a disc file and how to write one too.
3) Depending on what is your homework:
3.1) Find a library that do Huffman encoding/ decoding, read its documentation to use it.
3.2) Find reference documentation about Huffman encoding/decoding, study it, and write your how code.

Internet is full of resources if you dare to search. Google is your friend.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
 
Share this answer
 
Huffman coding is a beautiful achievement of Computer Science. I suggest you to read the original article. You may also find many freely available tutorials on the web (I'm pretty confident you are able to find open source implementations as well).
Using C++, you could take advantage of the std::make_heap[^] library function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900