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}"); } }
public HuffINode(IHuffNode leftNode, IHuffNode rightNode, int weight) { LeftNode = leftNode; RightNode = rightNode; Weight = weight; }
public HuffmanTree(IHuffNode lNode, IHuffNode rNode, int weight) { RootNode = new HuffINode(lNode, rNode, weight); }