Beispiel #1
0
 private static void GetPrefixCodes2()
 {
     if (Root.IsLeaf())
     {
         CharacterTable2.Add("1", Root.Fact);
     }
     else
     {
         PrefixCodes2(Root, "");
     }
 }
Beispiel #2
0
 private static void PrefixCodes2(Nodo Node, string desc)
 {
     if (Node.IsLeaf())
     {
         CharacterTable2.Add(desc, Node.Fact); return;
     }
     else
     {
         if (Node.LeftNode != null)
         {
             PrefixCodes2(Node.LeftNode, desc + "0");
         }
         if (Node.RightNode != null)
         {
             PrefixCodes2(Node.RightNode, desc + "1");
         }
     }
 }