Can someone point me in the right direction on implementing a merge sort.
Here is what the main program will look like. THanks.
int main(void)
{
int ar[100];
int i, v, len;
for (i=0; i<100; i++) {
cout << "enter a number (-1 to quit): ";
cin >> v;
if (v < 0) break;
ar[i] = v;
}
len = i;
cout << "main: before sort:\n";
for (i=0; i<len; i++) {
cout << "main: ar[" << i << "] = " << ar[i] << endl;
}
mergesort ms(ar, len);
cout << "main: after sort:\n";
for (i=0; i<len; i++) {
cout << "main: ar[" << i << "] = " << ar[i] << endl;
}