Although merge sort runs in (n lg n) worst-case time and insertion sort runs in (n2) worst-case
Question:
a. Show that the n/k sub lists, each of length k, can be sorted by insertion sort in Θ (nk) worst-case time.
b. Show that the sub lists can be merged in Θ (n lg (n/k) worst-case time.
c. Given that the modified algorithm runs in Θ(nk + n lg (n/k)) worst-case time, what is the largest asymptotic (Θ notation) value of k as a function of n for which the modified algorithm has the same asymptotic running time as standard merge sort?
d. How should k be chosen in practice?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Modeling the Dynamics of Life Calculus and Probability for Life Scientists
ISBN: 978-0840064189
3rd edition
Authors: Frederick R. Adler
Question Posted: