BinarySearchTree<TKey,TValue>.Add method (1 of 2)

Adds a node to the tree.

public void Add(KeyValuePair<TKey, TValue> pair)
parameter description
pair KeyValuePair containing both the Key and Value to add together.

Exceptions

exception condition
ArgumentNullException Thrown if key is null.
ArgumentException Thrown if key already exists in the tree.
InvalidCastException Thrown if key is not of type IComparable.

See Also


BinarySearchTree<TKey,TValue>.Add method (2 of 2)

Adds a node to the tree.

public virtual void Add(TKey key, TValue data)
parameter description
key Key used for comparison and lookup.
data Data to be contained at the new node location.

Exceptions

exception condition
ArgumentNullException Thrown if key is null.
ArgumentException Thrown if key already exists in the tree.
InvalidCastException Thrown if key is not of type IComparable.

See Also