\begin{verbatim}
   1: void Mergesort( int A[], int n, int C[] ) {
   2: // sort A[0],A[1],...,A[n] into ascending order
   3: // C is an array of length n for working storage
   4:    int n1,n2,*B;
   5:    if( n<=1 ) return;
   6:    n1 = n/2;
   7:    n2 = n-n1;
   8:    B = A + n1;
   9:    Mergesort(A,n1,C); // sort the first half of A
  10:    Mergesort(B,n2,C); // sort the second half of A
  11:    Merge(A,n1,B,n2,C); // merge A and B into C
  12:    for( i=0; i<n; i++ ) A[i] = C[i]; // copy C into A
  13:    return;
  14: }
\end{verbatim}
