public static void mergesort(int[ ] list, int first, int n)
  {
    int n1; // Size of the first half of the array
    int n2; // Size of the second half of the array
    
    if (n > 1)
    {
      // Compute sizes of the two halves
      n1 = n / 2;
      n2 = n - n1;
      
      mergesort(list, first, n1);      // Sort list[first] through list[first+n1-1]
      mergesort(list, first + n1, n2); // Sort list[first+n1] to the end
      
      // Merge Call
      // Merge the two sorted halves.
      merge(list, first, n1, n2);
    }
  }