n-ary Huffman Template Algorithm

n-ary Huffman Template Algorithm allows any kind of weights (costs, frequencies), including non-numerical ones. The {0, 1, ..., n-1} alphabet is used to encode messages. The built tree is an n-ary one. The algorithm is based on a set of template classes: Cell(SYMBOL, WEIGHT), Node(SYMBOL, WEIGHT), InternalNode (SYMBOL, WEIGHT), TerminalNode(SYMBOL, WEIGHT), BasicHuffmanTree(SYMBOL, WEIGHT, ARY), LoadedHuffmanTree(SYMBOL, WEIGHT, ARITY), and DriedHuffmanTree(WEIGHT, ARITY). (Source: http://freecode.com/)