如何在C中为重复的字母编码霍夫曼代码? [英] How to code huffman code for duplicated alphabets in C?

查看:120
本文介绍了如何在C中为重复的字母编码霍夫曼代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,伙计们。我想知道你是否可以帮我完成我的作业。我目前是本科软件工程专业的学生。

霍夫曼代码[问题描述]对于英文文章,计算26个小写字母的出现频率,然后用霍夫曼​​代码编码。 [基本要求] 1)从文件中读取原始文本文件并在屏幕上显示文本.2)输出26个英文小写字母的出现次数和相应的编码。原始文本文件包含:ahfsgdfdjgkjhkdhdkjgdhfagsfgdjsfdkjshdklsjdlkdkjgkjgdfhjgshfjdjkdfkjlkhlklsjksdjgdsfgsfa



我尝试过:



我无法想出任何东西。

解决方案

Quote:

I无法想出任何东西。

抱歉,我们不提供作业写作服务。如果您不理解这个问题,那么您应该和您的老师讨论。


如果您不理解该算法,请阅读原始的Huffman的文章,这是非常好的解释。 />
使用 C ++ 可以使您的任务更简单(例如 make_heap [ ^ ]由 C ++ 标准库轻轻提供。

请更加努力并仅在此处发布特定问题。


Quote:

如何在C中为重复的字母编码霍夫曼代码?



没有重复问题中的字母表,或者你需要定义它对你意味着什么。

引用:

我不能想出了什么。



这是不可能的,或者你需要与老师认真对话。

您需要考虑需求并列出要执行的任务订购要求的每个部分。

查看您可以解决哪些任务以及哪些任务无法解决。

显示您的工作并询问具体问题。



我们不做你的家庭作业。

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

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

你的任何失败都会帮助你了解什么有效,什么无效,被称为'试错'学习。

所以,试一试,重读课程并开始工作。如果您遇到特定问题,请展示您的代码并解释这个问题,我们可能会提供帮助。


Hi, guys. I was wondering if you can help me with my homework. I am currently an undergraduate Software Engineering student.
Huffman Code [Problem Description] For an English article, the frequency of occurrence of 26 lowercase letters are counted, and then they are encoded by Hoffman code. [Basic Requirements] 1) Read the original text file from the file and display the text on the screen.. 2) Output the number of occurrences of 26 English lowercase letters, and the corresponding encoding. THE ORIGINAL TEXT file contains: ahfsgdfdjgkjhkdhdkjgdhfagsfgdjsfdkjshdklsjdlkdkjgkjgdfhjgshfjdjkdfkjlkhlklsjksdjgdsfgsfa

What I have tried:

I can't came up with anything.

解决方案

Quote:

I can't came up with anything.

Sorry we do not provide a homework writing service. If you do not understand the problem then you should discuss with your teacher.


If you don't understand the algorithm then please read the original Huffman's article, it is very well explained.
Using C++ would make your task simpler (for instance make_heap[^] is gently provided by the C++ standard library).
Try harder and post only specific questions here.


Quote:

How to code huffman code for duplicated alphabets in C?


There is no duplicated alphabet in the question, or you need to define what it means to you.

Quote:

I can't came up with anything.


It is just not possible, or you need to talk seriously with your teacher.
You need to think about the requirement and list the tasks to do in order for each part of requirement.
See which task you can solve and which ones you can't.
show your work and ask specific questions.

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.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.


这篇关于如何在C中为重复的字母编码霍夫曼代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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