Question: Question 5 : Let m be a large integer and consider m non - empty sorted lists L 1 , L 2 , dots, L
Question : Let be a large integer and consider nonempty sorted lists dots,
All numbers in these lists are integers. Let be the total length of all these lists.
Describe an algorithm that computes, in time, two integers a and with
such that
each list contains at least one number from the set dots, and
the difference is minimum.
For example, if
then the output can be or
As always, justify the correctness of your algorithm and explain why the running time is
Hint: Use a minheap of size and use Question For the example, draw it like this, then
stare at it until you "see" the algorithm:
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
