#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
class HNode {
public:
int weight;
string content;
string bit;
HNode *parent = nullptr, *lchild = nullptr, *rchild = nullptr;
};
class HCode {
public:
string content;
string bit;
HCode(string &c, string &b) {
this->content = c;
this->bit = b;
}
};
vector<HCode> Codes;
bool MyCompare(HNode *a, HNode *b) {
return a->weight > b
C++实现霍夫曼编码
最新推荐文章于 2025-03-25 21:58:09 发布