优先队列的重载(重新设置比较函数)

struct cmp

{

    bool operator() (HuffmanTree a, HuffmanTree b)

    {

        return a->weight>b->weight;

    }

};

priority_queue<HuffmanTree, vector<HuffmanTree>, cmp >pq;

猜你喜欢

转载自blog.csdn.net/weixin_42165786/article/details/89444959