Exemple #1
0
 public void Insert(int input)
 {
     if (IsEmpty())
     {
         root = new Node(input);
     }
     root.InsertData(ref root, input);
     count++;
 }
Exemple #2
0
 public void InsertBranchRight(int treeBranch)
 {
     if (rightBranch != null)
     {
         rightBranch.InsertData(treeBranch);
     }
     else
     {
         rightBranch = new Node(treeBranch);
     }
 }
Exemple #3
0
 public void InsertBranchLeft(int treeBranch)
 {
     if (leftBranch != null)
     {
         leftBranch.InsertData(treeBranch);
     }
     else
     {
         leftBranch = new Node(treeBranch);
     }
 }
Exemple #4
0
 public void RootInsert(int treeBranch)
 {
     if (root != null)
     {
         root.InsertData(treeBranch);
     }
     else
     {
         root = new Node(treeBranch);
     }
 }
 public void Insert(int d)
 {
     if (IsEmpty())
     {
         root = new Node(d);
     }
     else
     {
         root.InsertData(ref root, d);
     }
     count++;
 }
Exemple #6
0
        public void Insert(int d, string r)
        {
            if (IsEmpty())
            {
                root = new Node(d, r);
            }
            else
            {
                root.InsertData(ref root, d, r);
            }

            count++;
        }