随笔分类 -  哈弗曼编码

摘要:裸裸的哈弗曼编码,求出哈弗曼编码的路径长度,注意整个字符串为一种字符的情况View Code #include<iostream>#include<queue>#include<algorithm>#include<vector>using namespace std;struct node{ int u,w; node(int a=0,int b=0):u(a),w(b){} bool friend operator <(const node a,const node b)//重载操作符 { return a.w>b.w; }};i 阅读全文
posted @ 2012-02-15 23:05 枕边梦 阅读(248) 评论(0) 推荐(0)