Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For NewMergeSort, implement a variant of MergeSort depends on an additional parameter k. The algorithm works as follows: 1. 2. if the size of the
For NewMergeSort, implement a variant of MergeSort depends on an additional parameter k. The algorithm works as follows: 1. 2. if the size of the portion of the array to be sorted is greater than k, it recursively calls the NewMergeSort algorithm with the same k; if the size of the portion of the array to be sorted is less than or equal to k, it sorts that portion using the InsertionSort algorithm. Empirically try different values of k (for instance, k = {5, 10, 25, 50, ...} and different array sizes. Find out for which values of k and for which array sizes NewMergeSort outperforms the standard MergeSort. Your submission should include a report of the following: Three tables summarizing the results (the running times in ms): one for each sorting algorithm with the different input sizes and different types of data. Table 1: Running times in ms for Insertion Sort. 3. Provide: 1. An analysis for which value of k and for which array sizes the standard Merge Sort algorithm starts to outperform the New MergeSort. 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started