What is the number of comparisons in the worst case to merge two sorted lists containing n elements each?A. 2nB. 2n-1C. 2n+1D. 2n-2

Showing Answers 1 - 5 of 5 Answers

kalaiarasi.k

  • Jul 31st, 2005
 

2n-1

  Was this answer useful?  Yes

saravnanan

  • Aug 2nd, 2005
 

2n-2

  Was this answer useful?  Yes

Consider List1 { 1, 3, 5} and List2 { 2, 4, 6}

This is an e.g of worst case. And it takes 2n - 1 comparisons.
where n = cardinality of the smaller set.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions