Home /
Expert Answers /
Computer Science /
using-your-preferred-programming-language-write-a-program-that-will-do-the-following-sort-a-set-o-pa403
(Solved): Using your preferred programming language, write a program that will do the following: Sort a set o ...
Using your preferred programming language, write a program that will do the following: Sort a set of integers using the merge sort algorithm from the textbook. Calculate the time complexity and comparison time for each algorithm to sort 10[1,2,3,4,5] integer elements, then report on the actual runtime on each set. Finally, calculate how long it would take to run the merge sort algorithm on a set of 106 elements.
You will receive credit for this assignment if your program meets the following criteria: 1. executes and functions properly, 2. reads an argument from the command line, 3. outputs results to a file, 4. correctly implements the merge sort algorithms, 5. accurately sorts the first 10 elements for the algorithm, 6. accurately reports the time complexity based on the personal system clock 7. accurately reports the comparison times based on the personal system clock, 8. and reports the actual runtime for the merge sort algorithm for the given set lengths.
All the data in the array will be stored in sortedNumbers.txt import java.lang.*; import java.io.*; class Merge { void merge(int a[], int beg, int mid, int end) { int i, j, k; int n1 = mid - beg + 1; int n2 = end - mid; int LeftArray[] = new int[n1];