CircularListTInsertRange Method

Inserts a collection into the CircularListT at the specified index.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public void InsertRange(
	int index,
	IEnumerable<T> collection
)

Parameters

index  Int32
The zero-based index at which collection items should be inserted.
collection  IEnumerableT
The collection to insert into the list.

Implements

ISupportsRangeListTInsertRange(Int32, IEnumerableT)

Remarks

If the length of the CircularListT is n and the length of the collection to insert is m, then inserting to the first or last position has O(m) cost.

If capacity increase is needed (considering actual list size), or when the collection is inserted in the middle of the CircularListT, the cost is O(Max(n, m)), and in practice no more than n/2 elements are moved.

Exceptions

ArgumentOutOfRangeExceptionindex is not a valid index in the CircularListT.
ArgumentNullExceptioncollection must not be .

See Also