in Algorithms recategorized by
1,851 views
5 votes
5 votes

Given two sorted list of size '$m$' and '$n$' respectively. The number of comparisons needed in the worst case by the merge sort algorithm will be :

  1. $m^{*}n$
  2. minimum of $m, n$
  3. maximum of $m, n$
  4. $m+n-1$
in Algorithms recategorized by
by
1.9k views

5 Answers

0 votes
0 votes

The worst case will be 0(m+n-1) where “m” and “n” are the sizes of the respective lists

Why “-1” at the end?

because when the two lists are being compared and sorted, at the end 1 element might be left which requires no comparison, hence -1. 

Answer:

Related questions