コード例 #1
0
ファイル: TernaryTree.cs プロジェクト: leofidus/itext7-dotnet
        /// <summary>Balance the tree for best search performance</summary>
        public virtual void Balance()
        {
            // System.out.print("Before root splitchar = "); System.out.println(sc[root]);
            int i = 0;
            int n = length;

            String[]            k    = new String[n];
            char[]              v    = new char[n];
            TernaryTreeIterator iter = new TernaryTreeIterator(this);

            while (iter.MoveNext())
            {
                v[i]   = iter.GetValue();
                k[i++] = (String)iter.Current;
            }
            Init();
            InsertBalanced(k, v, 0, n);
        }
コード例 #2
0
 public Item(TernaryTreeIterator _enclosing, TernaryTreeIterator.Item i)
 {
     this._enclosing = _enclosing;
     this.parent     = i.parent;
     this.child      = i.child;
 }
コード例 #3
0
 /// <summary>Construct item.</summary>
 /// <param name="p">a char</param>
 /// <param name="c">a char</param>
 public Item(TernaryTreeIterator _enclosing, char p, char c)
 {
     this._enclosing = _enclosing;
     this.parent     = p;
     this.child      = c;
 }
コード例 #4
0
 /// <summary>default constructor</summary>
 public Item(TernaryTreeIterator _enclosing)
 {
     this._enclosing = _enclosing;
     this.parent     = (char)0;
     this.child      = (char)0;
 }