/// <summary> /// The btree. /// </summary> /// <param name="table"></param> public BitTree(CodesTable table) { _table = table; _eos = CodesTable.Eos; _root = new Node(false, null); BuildTree(table); }
/// <summary> /// Build the tree. /// </summary> /// <param name="table">The code table.</param> private void BuildTree(CodesTable table) { foreach (var bits in table.HuffmanTable.Keys) { Add(bits); } Add(CodesTable.Eos); }
/// <summary> /// Huffman compression processor algorithm. /// </summary> public Processor() { _table = new CodesTable(); _tree = new BitTree(_table); }