www.nhft.net > 哈夫曼编码 C语言

哈夫曼编码 C语言

#include #include typedef struct node{ char c; int count;}nd;int cmp(const void* p1, const void*p2){ nd*c = (nd*...

#include #define MAX 30 #define inf 100000000 typedef char valType; typedef int wghType; struct HFMnode { valType data; wghType weight; int parent; int lchild; int rchild; }; struct HFMcode { char code[MAX]; int start; }; void ...

#include #include #define MAXINF 10000 struct htnode { int ww; int parent,llink,rlink; }; struct httree { int m; int root; struct htnode *ht; }; typedef struct httree *phttree; phttree huffman(int m,int *w) { phttree pht; int i...

#include #include #include #include #include int function1(char ch,char *s) { int i; for(i=0; s[i]!='\0'; i++) { if(ch==s[i])return 0; } return 1; } typedef struct { unsigned int weight; unsigned int parent,lchild,rchild; } HTN...

//*************预定义**************** # include # include # include # include # include # define MAX_LENGTH 100 typedef char **HuffmanCode; //**********数据结构************* typedef struct { int weight; //权值 int parent,lchild...

写过哈夫曼树,这个可以帮你写!

哈夫曼编码 是个很经典的算法,自己去实现还是很有帮助的

这里有个C写的,VC++6.0可以编译 《基于哈夫曼(haffuman)算法的文件压缩的实现(C语言)(原创)》

#include #include #include struct huffmantree { char zifu; int weight; int parent,lchild,rchild; }; struct huffmancode { char cd[50]; int start; }; int *select(struct huffmantree HT[],int n,int s[]) { int i,min1,min2; min1 = 32...

#include #include #include typedef unsigned char U8; typedef unsigned short U16; typedef unsigned long U32; typedef struct HuffmanNode { double prob; struct HuffmanNode *left; struct HuffmanNode *right; }huffmancode; void Init ...

网站地图

All rights reserved Powered by www.nhft.net

copyright ©right 2010-2021。
www.nhft.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com