BinarySearchTree<TKey,TValue>.Remove method (1 of 2)
Removes the node containing this data from the tree.
public bool Remove(KeyValuePair<TKey, TValue> pair)
parameter | description |
---|---|
pair | KeyValuePair to remove from the tree. |
Return Value
True if an item is removed from the tree. False if the item is not found.
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if key is null. |
InvalidCastException | Thrown if key is not of type IComparable. |
Remarks
If data does not exist in the tree, then the tree remains unchanged. No exception is thrown.
See Also
- class BinarySearchTree<TKey,TValue>
- namespace TheCodingMonkey.Collections.BST
BinarySearchTree<TKey,TValue>.Remove method (2 of 2)
Removes the node containing this data from the tree.
public virtual bool Remove(TKey key)
parameter | description |
---|---|
key | Value to remove from the tree. |
Return Value
True if an item is removed from the tree. False if the item is not found.
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if key is null. |
InvalidCastException | Thrown if key is not of type IComparable. |
Remarks
If data does not exist in the tree, then the tree remains unchanged. No exception is thrown.
See Also
- class BinarySearchTree<TKey,TValue>
- namespace TheCodingMonkey.Collections.BST