The algorithm allows any kind of weights (costs, frequencies), including non-numerical ones. The {0, 1, ..., n-1} alphabet is used to encode message. Built tree is n-ary one.The algorithm is based on a set of template classes : Cell(SYMBOL, WEIGHT), Node(