⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huffman.h

📁 该源码实现了从文件中读取字符串
💻 H
字号:
//存储霍夫曼树节点的数据结构
typedef struct treenode
{
    char data;                    //存储要编码的字符
    int weight;                   //存储要编码的字符的权重
    struct treenode* parent;    //父节点
    struct treenode* lchild;    //左子树
    struct treenode* rchild;    //右子树
}TreeNode;

//存储霍夫曼码表单元的数据结构
typedef struct nodecode
{
	char node;     //存储要编码的字符
	string huffmancode;//存储相应字符的霍夫曼码
}Nodecode;

//定义全局变量
 static int N;  //记录文件中出现的字符总数
 static nodecode s[30];//计算出的霍夫曼码表
 static int index=0; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -