BinarySearchTree<TKey,TValue>.CopyTo method

Copies the Tree elements to a one-dimensional Array instance at the specified index.

public void CopyTo(KeyValuePair<TKey, TValue>[] array, int index)
parameter description
array The one dimensional Array to copy the elements to.
index The zero-based index in array at which copying begins.

Exceptions

exception condition
ArgumentNullException Thrown if array is null.
ArgumentOutOfRangeException Thrown if index is less than zero or if index is greater than the size of array.
ArgumentException Thrown if the number of items in the list is greater than the available space in array.
InvalidCastException The type of the source Tree cannot be cast automatically to the type of the destination array.

See Also