BinarySearchTree<TKey,TValue> class

Basic Unbalanced Binary Search Tree Implementation.

public class BinarySearchTree<TKey, TValue> : ICloneable, IDictionary<TKey, TValue>
    where TKey : IComparable<TKey>

Public Members

name description
BinarySearchTree() Default Constructor.
Count { get; protected set; } Returns the number of items in the tree.
Empty { get; } Returns true if the tree is empty.
IsReadOnly { get; } Gets a value indicating whether the Skip List is read-only.
Item { get; set; } Indexer for the Binary Search Tree.
Keys { get; } Gets an ICollection containing the keys of the Tree.
Values { get; } Gets an ICollection containing the values of the Tree.
Add(…) Adds a node to the tree.
virtual Add(…) Adds a node to the tree.
virtual Clear() Removes all items from the Tree.
Clone() Makes a deep copy of this Tree.
Contains(…) Determines if the value is contained somewhere in the tree.
virtual ContainsKey(…) Determines if the value is contained somewhere in the tree.
CopyTo(…) Copies the Tree elements to a one-dimensional Array instance at the specified index.
Remove(…) Removes the node containing this data from the tree.
virtual Remove(…) Removes the node containing this data from the tree.
TryGetValue(…) Attempts to retrieve the value for the given key.

Protected Members

name description
virtual CloneInstance() Helper function used during Clone to create the correct instance of the specific Binary Search Tree implementation
Search(…) Recursive function used to find a given value in a subtree where current is the root node.

See Also