Esempio n. 1
0
 private static void PrintHelp(IHuffNode node)
 {
     if (node is HuffINode x)
     {
         Console.WriteLine("\nNode : " + node.Weight);
         PrintHelp(x.LeftNode);
         PrintHelp(x.RightNode);
     }
     if (node.Leaf)
     {
         Console.WriteLine($" Leaf : {node.Weight}");
     }
 }
Esempio n. 2
0
 public HuffINode(IHuffNode leftNode, IHuffNode rightNode, int weight)
 {
     LeftNode  = leftNode;
     RightNode = rightNode;
     Weight    = weight;
 }
Esempio n. 3
0
 public HuffmanTree(IHuffNode lNode, IHuffNode rNode, int weight)
 {
     RootNode = new HuffINode(lNode, rNode, weight);
 }