Merge() static private method

static private Merge ( List left, List right ) : List
left List
right List
return List
Esempio n. 1
0
 public static void MergeSort(int[] input, int low, int high)
 {
     if (low < high)
     {
         int middle = (low / 2) + (high / 2);
         MergeSort(input, low, middle);
         MergeSort(input, middle + 1, high);
         MergeSortAlgorithm.Merge(input, low, middle, high);
     }
 }
Esempio n. 2
0
 public void MergeSort()
 {
     int[] arr = { 31, 41, 59, 26, 41, 58 };
     MergeSortAlgorithm.Merge(arr, 0, arr.Length);
     CollectionAssert.AreEqual(arr, new int[] { 26, 31, 41, 41, 58, 59 });
 }