public void Reverse() { for (int i = 0; i < arr.Length / 2; ++i) { AuxFunc.Swap(ref arr[i], ref arr[arr.Length - 1 - i]); } }
public void Reverse() { for (int i = 0; i < top / 2; ++i) { AuxFunc.Swap(ref arr[i], ref arr[top - 1 - i]); } }
public void Reverse() { for (int i = 0; i < Size() / 2; ++i) { AuxFunc.Swap(ref arr[i + start], ref arr[end - i - 1]); } }
public void HalfReverse() { int n = arr.Length; int slide = n % 2 == 1 ? 1 : 0; for (int i = 0; i < n / 2; ++i) { AuxFunc.Swap(ref arr[i], ref arr[i + n / 2 + slide]); } }
public void HalfReverse() { int n = Size(); int slide = n % 2 == 1 ? 1 : 0; for (int i = 0; i < n / 2; ++i) { AuxFunc.Swap(ref arr[i + start], ref arr[i + n / 2 + slide + start]); } }
public void Sort() { for (int i = 1; i < arr.Length; ++i) { int j = i; while ((j > 0) && (arr[j] < arr[j - 1])) { AuxFunc.Swap(ref arr[j - 1], ref arr[j]); --j; } } }
public void Sort() { for (int i = start; i < end; ++i) { int j = i; while ((j > start) && (arr[j] < arr[j - 1])) { AuxFunc.Swap(ref arr[j - 1], ref arr[j]); --j; } } }