哈夫曼树template
class Node //代表各个字符的结点
{
public:
int data;
string code;
shared_ptr<Node> leftChild,rightChild;
Node():leftChild(nullptr),rightChild(nullptr),code(""){}
};
template<typename T>
class Greater
{
public:
bool operator()(T a, T b){.
原创
2022-02-27 11:14:26 ·
154 阅读 ·
0 评论