Anonymous user
Huffman coding: Difference between revisions
→{{header|C++}}
(added Fantom example) |
|||
Line 630:
{
public:
const int f;
virtual ~INode() {}
Line 641:
{
public:
INode *const
INode *const right;
InternalNode(INode* c0, INode* c1) : INode(c0->f + c1->f), left(c0), right(c1) {}
~InternalNode()
{
delete
delete
}
};
Line 658 ⟶ 655:
{
public:
const char c;
LeafNode(int f, char c) : INode(f), c(c) {}
};
struct NodeCmp
{
bool operator()(const INode* lhs, const INode* rhs) { return
};
|