Question: Let Ll, for 1 i 4, be four lists of numbers, each sorted in ascending order. The numbers of entries in these lists

Let Ll, for 1 ≤ i ≤ 4, be four lists of numbers, each sorted in ascending order. The numbers of entries in these lists are 75, 40, 110, and 50, respectively.
(a) How many comparisons are needed to merge these four lists by merging L1 and L2, merging L3 and L4, and then merging the two resulting lists?
(b) How many comparisons are needed if we first merge L1 and L2, then merge the result with L3, and finally merge this result with L4?
(c) In order to minimize the total number of comparisons in this merging of the four lists, what order should the merging follow?
(d) Extend the result in part (c) to n sorted lists L1, L2,..., Ln.

Step by Step Solution

3.40 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a To merge lists L 1 and L 2 requires at most 75 40 1 114 comparisons f... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

954-M-L-A-L-S (8289).docx

120 KBs Word File

Students Have Also Explored These Related Linear Algebra Questions!