Пример #1
0
 public CPair(CPair rLeftSon, CPair rRightSon)
 {
     this.sSymbols     = rLeftSon.Symbols + rRightSon.Symbols;
     this.fProbability = rLeftSon.Probability + rRightSon.Probability;
     rLeftSon.UpdateCodes("1");
     rRightSon.UpdateCodes("0");
     this.rLeftSon          = rLeftSon;
     this.rRightSon         = rRightSon;
     this.rLeftSon.rParent  = this;
     this.rRightSon.rParent = this;
 }
Пример #2
0
 private void UpdateCodes(string cCode)
 {
     sCodes = cCode + sCodes;
     if (rLeftSon != null)
     {
         rLeftSon.UpdateCodes(cCode);
     }
     if (rRightSon != null)
     {
         rRightSon.UpdateCodes(cCode);
     }
 }