哈夫曼树算法(数据结构C++描述)
摘要:
//哈夫曼树算法
#include<iostream>
using namespace std;
const int n=5;
const int m=2*n-1;
const int float_max=20;
typedef int datatype;
typedef struct { float weight; //定义权重 int parent; //定义双亲在向量中的下标 int lchild,rchild; //定义左右子树
} nodetype; //结点类型
typedef nodetype hftree[m]; //哈夫曼树类型,数组从0号单元开始使... 阅读全文
posted @ 2011-11-26 22:28 1.曲待续 阅读(5158) 评论(0) 推荐(0) 编辑