如何使用C ++中的霍夫曼编码压缩和解压缩输入的文件文本? [英] How to compress and decompress the inputted file text using huffman coding in C++?

查看:172
本文介绍了如何使用C ++中的霍夫曼编码压缩和解压缩输入的文件文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用路径输入文本文件



使用huffman算法压缩文件

将其存储为文本文件



解压缩文件唱霍夫曼算法

再次将其存储为文本文件。



< b>我尝试了什么:



压缩和解压应该是don filesize应该压缩

解决方案

我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但是我们不会为你做这一切!


霍夫曼算法 - Google搜索 [ ^ ]


Quote:

如何使用C ++中的huffman编码压缩和解压缩输入的文件文本?



1)学习C ++。

2)学习如何阅读光盘文件以及如何编写光盘文件。

3)取决于你的作业是什么:

3.1)找一个做霍夫曼编码/解码的库,阅读它的文档来使用它。

3.2)找到关于霍夫曼编码/解码的参考文档,研究它,并写下你的代码。



如果你敢于搜索,互联网上充满了资源。谷歌是你的朋友。



我们不做你的家庭作业。

HomeWork不会在乞求别人做的时候测试你的技能你的工作,它会让你思考并帮助你的老师检查你对你所学课程的理解,以及你应用它们时遇到的问题。

如果您失败,将帮助您的老师发现您的弱点并设置补救措施。


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

解决方案

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!


huffman algorithm - Google Search[^]


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.


这篇关于如何使用C ++中的霍夫曼编码压缩和解压缩输入的文件文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆