Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Insert(T value) {
- //while (true)
- //{
- if (_Value.CompareTo(value) > 0)
- {
- if (LeftChild == null)
- {
- LeftChild = new BinarySearchTreeNode<T>(value);
- LeftChild.Parent = this;
- }
- else LeftChild.Insert(value);
- }
- else if (_Value.CompareTo(value) <= 0)
- {
- if (RightChild == null)
- {
- RightChild = new BinarySearchTreeNode<T>(value);
- RightChild.Parent = this;
- }
- else RightChild.Insert(value);
- //this.Value = RightChild.Value;
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement