Question: Imagine that there exists an algorithm (SPLIT_k) that can split a list (L) of (n) elements into (k) sublists, each containing one or more elements,
Imagine that there exists an algorithm \(SPLIT_k\) that can split a list \(L\) of \(n\) elements into \(k\) sublists, each containing one or more elements, such that sublist \(i\) contains only elements whose values are less than all elements in j for i
Furthermore, assume that the k lists can be concatenated again in constant time. Consider the following algorithm:
![List SORTK (List L) { List sub [k]; // To hold the sublists if (L. length() > 1) { SPLITK (L, sub); // SPLITK](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1705/3/2/2/01765a5262195a1c1705322017648.jpg)
(a) What is the worst-case asymptotic running time for SORTk? Why?
(b) What is the average-case asymptotic running time of SORTk? Why?
List SORTK (List L) { List sub [k]; // To hold the sublists if (L. length() > 1) { SPLITK (L, sub); // SPLITK places sublists into sub for (i=0; i
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
a The worstcase asymptotic running time for SORTK can be analyzed as follows 1 SPLITK takes On time ... View full answer
Get step-by-step solutions from verified subject matter experts
