Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following variation of merge sort where the recursive calls are made only till the list is large; if the list is small, insertion

Consider the following variation of merge sort where the recursive calls are made only till the list is large; if the list is small, insertion sort is used is used to sort the list.

NewMergeSort(array A)

{

if A has L or fewer elements then InsetionSort(A) else

{

split A into Left and Right;

NewMergeSort(Left); NewMergeSort(Right); Merge Left and Right

}

}

What you have to do in this problem is to see what value of L gives the best results.

1. Consider at least the following values of L: 1, 2, 4, 8, 16, 32, 64.

2. Generate large random arrays (i.e. the values of the arrays are generated using a random number generator)

run NewMergeSort with different values of L and see which value of L yields the fastest result.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions