Пример #1
0
        static void importfromfileTest(string[] args)
        {
            Dictionary<char, int> zeichentabelle;
            Dictionary<char, double> relativeAnzahl;

            string file = args[0];
            string text = "";
            try
            {
                text = Dictcreator.getInput(file);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            zeichentabelle = Dictcreator.createDictionaryFromString(text);
            relativeAnzahl = Dictcreator.getRelativeFrequencyDict(zeichentabelle);
            HuffmanTree tree = new HuffmanTree(relativeAnzahl);

            tree.printTree(tree.root);
        }