public void Insert(int input) { if (IsEmpty()) { root = new Node(input); } root.InsertData(ref root, input); count++; }
public void InsertBranchRight(int treeBranch) { if (rightBranch != null) { rightBranch.InsertData(treeBranch); } else { rightBranch = new Node(treeBranch); } }
public void InsertBranchLeft(int treeBranch) { if (leftBranch != null) { leftBranch.InsertData(treeBranch); } else { leftBranch = new Node(treeBranch); } }
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++; }
public void Insert(int d, string r) { if (IsEmpty()) { root = new Node(d, r); } else { root.InsertData(ref root, d, r); } count++; }