예제 #1
0
 public Node(string s)
 {
     LeftChild  = null;
     RightChild = null;
     Info       = s;
     _sum_codes = SumOfCodes.GetSum(s);
 }
예제 #2
0
 internal void Add(Node node1, string s)
 {
     if (SumOfCodes.GetSum(s) <= node1.SumCodes)
     {
         if (node1.LeftChild == null)
         {
             node1.LeftChild = new Node(s);
         }
         else
         {
             Add(node1.LeftChild, s);
         }
     }
     else
     {
         if (node1.RightChild == null)
         {
             node1.RightChild = new Node(s);
         }
         else
         {
             Add(node1.RightChild, s);
         }
     }
 }
예제 #3
0
 public NodeOfList(string info)
 {
     Previous   = null;
     Next       = null;
     Info       = info;
     _sum_codes = SumOfCodes.GetSum(info);
 }