/* Mergesort * * Implement Mergesort. You should use a single implementation which * should run on any type that implements <, >, <=, >=, != and == * * For your testing purposes, iostream has been included * If there's any questions about the skeleton file, email us * */ using namespace std; #include /* Mergesort the given array 'elements' * Since in-place mergesort can get annoying, an output buffer will be passed in * that you should return * Don't get confused by the generics, just treat elements and output as any other array * and Comparable as any element implementing the operations described above */ template Comparable * mergesort(Comparable elements[], size_t size) { Comparable *output = new Comparable[size]; /* YOUR CODE HERE * Fill output with a sorted copy of elements */ return output; } int main() { }