Beispiel #1
0
        public static void FindOneShennon()
        {
            ShennonList = new List <Symbol>();
            ShennonList.AddRange(symbols);
            Symbol root = Shennon(ShennonList);

            ShowAllStart(root);
            BinWriter.writeLines(result);
        }
Beispiel #2
0
        public static void FindOneHuffman()
        {
            HuffmanList = new List <Symbol>();
            HuffmanList.AddRange(symbols);


            while (HuffmanList.Count > 1)
            {
                HuffmanList.Sort();
                HuffmanList.Reverse();
                Symbol ch = HuffmanList[0];
                HuffmanList.Remove(HuffmanList[0]);
                Symbol newOne = new Symbol(ch, HuffmanList[0]);
                HuffmanList.Remove(HuffmanList[0]);
                HuffmanList.Add(newOne);
            }

            ShowAllStart(HuffmanList[0]);
            BinWriter.writeLines(result);
        }