Method Swap
Swap<T>(ref T, ref T)
Swaps two values in place.
public static void Swap<T>(ref T a, ref T b)
Parameters
aTFirst value to swap.
bTSecond value to swap.
Type Parameters
TType of the values being swapped.
Swap<T>(ref T[], int, int)
Swaps two elements inside the same array.
public static void Swap<T>(ref T[] array, int i0, int i1)
Parameters
arrayT[]Array containing both elements.
i0intIndex of the first element.
i1intIndex of the second element.
Type Parameters
TElement type stored in the array.