Question: A variation of merge sort involves calling a bubble or insertion sort when we reduce to an array size that is small say less than

A variation of merge sort involves calling a bubble or insertion sort when we reduce to an array size that is small say less than 50. Rewrite the merge sort so that if the array partition we are looking at has a size less than 50, call insertion sort on that partition. Then using System.nanotime for a rough estimate and using random Integer arrays of Various Sizes (N) indicate how efficient the two sorts are using the following table to record your results. Also include estimates for the time it would take to this using a bubble sort.

Include all the necessary methods to complete this task in a class file called SortQuestion

A variation of merge sort involves calling a bubble or insertion sort

\begin{tabular}{|l|l|l|l|l|} \hline \multicolumn{1}{|c|}{N} & Merge Sort & Modified Merge Sort & Bubble Sort & Insertion Sort \\ \hline 1000 & & & & \\ \hline 10000 & & & & \\ \hline 100000 & & & & \\ \hline 1000000 & & & & \\ \hline 10000000 & & & & \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!