Question: ) Suppose you are given k sorted non - empty lists A 1 , dots, A k that consist of n elements in total. Your
Suppose you are given sorted nonempty lists dots,
that consist of elements in total. Your task is to merge them into one
big sorted list. We will use the merge procedure described in class, which
can merge two lists into one in linear time, ie in time where
and are the sizes of the two input lists, respectively. You may
assume that is a power of
a points Consider the following simple iterative algorithm: First
merge and into one list, then merge the resulting list with
then dots, Show that the worstcase running time of this
algorithm is
b points Show that the running time is tight, ie its running
time is also thus
c points What's the bestcase running time of this iterative algo
rithm? Explain.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
