Thursday, July 30, 2009

Can anyone convert this to a code in C++, please?

Can anyone convert the following to a code in C++, please?








void mergesort (int n, keytype S[])


{


if (n%26gt;1) {


const int h=[n/2], m = n - h;


int U[1 ..h], V[1 ..m];


copy S[1] through S[h] to U[1] through U[h];


copy S[h+1] through S[n] to V[1] through V[m];


mergesort(h, U);


mergesort(m, V);


merge (h, m, U, V, S);


}


}

Can anyone convert this to a code in C++, please?
This may help you:





http://www.algorithmist.com/index.php/Me...

gardenia

No comments:

Post a Comment