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

            count++;
        }