• edited by
4,451 views
4 4 votes
. In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared?

a)2

b)logn

c)n-1

d)nlogn

1 Answer

0 0 votes
I think , if we want the maximum number of comparisons to be made for an element then let us assume that element to be the comapared is the biggest in the given array , so at level 0 , 2^0 comparison is done

 At level 1, 2^1 comparisons will be done

At level 2, 2^2 comparisons will be done

.

.

.

Similarly at kth level 2^k comparison will be done .

Therefore total number of comparisons made will be summation of all the comparisons.

Plz comment if this analysis is wrong

 

.
Position:
Show:

Related questions

0 0 votes
0 0 answers
876
876 views
Prince Sindhiya asked Aug 23, 2018
876 views
i mark the option D) but answer is A)
4 4 votes
4 answers 4 answers
4.9k
4.9k views
Ramij asked Dec 20, 2018
4,873 views
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst ca...
4 4 votes
4 4 answers
3.4k
3.4k views
Aibi asked Oct 8, 2017
3,397 views
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is(A) (n log n) / 2(B) n ...
1 1 vote
2 2 answers
6.0k
6.0k views
Shubhanshu asked Dec 1, 2018
5,956 views
Is Quick sort an adaptive sorting Algorithm? I think no. Because as per the definition given in the Wikipedia is that A adaptive sorting Algorithm is one who takes the ad...