int main(int argc, const char * argv[]) { int a[] = {6, 1, 2, 5, 3, 4, 2}; Sort var = *new Sort; var.mergeSort(a, 7); for(int i=0; i<7;i++){ cout<<a[i]<<'\t'; } }
int main(int argc, char const* argv[]) { int a[] = {1, 45, 2, 69, 6, 88}; int size = sizeof a/sizeof (a[0]); // merge(a, 0, size/2, size); Sort t; t.mergeSort (a, 0, size-1); for (int i=0; i<size; ++i) std::cout << a[i] << "\t"; std::cout << std::endl; return 0; }