/********************************************************************* C311 Spring 2021 Authors: Dana Vrajitoru & W. Knight Functions implementing the merge sort. ********************************************************************/ #include #include using namespace std; #include "merge_sort.h" const int LIMIT = 500; // Outputs an array to the console void print_array(int *a, int size); int main() { int *arr, size, i; cout << "Enter the size of the array" << endl; cin >> size; arr = new int[size]; for (i = 0; i < size; i++) arr[i] = rand() % LIMIT; cout << "Raw array : "; print_array(arr, size); merge_sort(arr, 0, size-1); cout << "Sorted array : "; print_array(arr, size); } // Outputs an array to the console void print_array(int *a, int size) { cout << "Here is the array:" << endl; for (int i = 0; i < size; i++) cout << a[i] << ' '; cout << endl; }