A variation of merge sort involves calling a bubble or insertion sort when we reduce to an
Fantastic news! We've Found the answer you've been seeking!
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 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 Sort Question
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: