Пример #1
0
 /// <summary>
 /// Sort elements in array.
 /// </summary>
 /// <param name="array">passing array</param>
 /// <param name="left">leftArray border of sorting</param>
 /// <param name="rihgt">rightArray border of sorting</param>
 public static void Sort(T[] array, int left, int rihgt)
 {
     CheckSortParameters.CheckFullParam(array, left, rihgt);
     T[] partArray = GetSubArray(array, left, rihgt);
     Sort(partArray);
     for (int i = left; i < rihgt; i++)
     {
         array[i] = partArray[i];
     }
 }
Пример #2
0
 /// <summary>
 /// Sort array from left to right border.
 /// </summary>
 /// <param name="array">passing array</param>
 /// <param name="left">left border</param>
 /// <param name="right">right border</param>
 public static void Sort(T[] array, int left, int right)
 {
     CheckSortParameters.CheckFullParam(array, left, right);
     SortPart(array, left, right);
 }
Пример #3
0
 /// <summary>
 /// Sort elements in array.
 /// </summary>
 /// <param name="array">passing array</param>
 public static void Sort(T[] array)
 {
     CheckSortParameters.CheckParamArray(array);
     T[] result = SortWithMerge(array);
     result.CopyTo(array, 0);
 }
Пример #4
0
 /// <summary>
 /// Sort array
 /// </summary>
 /// <param name="array">passing array</param>
 public static void Sort(T[] array)
 {
     CheckSortParameters.CheckParamArray <T>(array);
     SortPart(array, 0, array.Length - 1);
 }