Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..RotateInPlace<(Of <(<'T>)>)> Method

Rotates a list or array in place.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static void RotateInPlace<T>(
	IList<T> list,
	int amountToRotate
)
Public Shared Sub RotateInPlace(Of T) ( _
	list As IList(Of T), _
	amountToRotate As Integer _
)
public:
generic<typename T>
static void RotateInPlace(
	IList<T>^ list, 
	int^ amountToRotate
)

Type Parameters

T

Parameters

list
Type: IList<(Of <(<'T>)>)>
The list or array to rotate.
amountToRotate
Type: Int32
The number of elements to rotate. This value can be positive or negative. For example, rotating by positive 3 means that list[3] is the first item in the resulting list. Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list.

Exceptions


ExceptionCondition
ArgumentNullExceptionlist is null.

Remarks


Although arrays cast to IList<T> are normally read-only, this method will work correctly and modify an array passed as list.