示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>Null, if tree is not complete.</returns>
        public HuffmanTree Create()
        {
            HuffmanTree temp = HuffmanLoader.NextNode();

            if ((temp.root.symbol == -1) && (temp.root.weight == 0))
            {
                return(null);
            }
            if (temp.root.symbol != -1)
            {
                return(temp);
            }
            temp.root.Left  = Create();
            temp.root.Right = Create();
            return(temp);
        }
示例#2
0
 public TreeLoader(HuffmanLoader hf)
 {
     HuffmanLoader = hf;
     LoadingStack  = new Stack <HuffmanTree>();
 }