edited by
2,482 views
1 votes
1 votes
Can pls someome. Tell.number of comparisons in. Merge sort in best case as well as worst case.

Acc to. Me, at. Each level we need O(n) comaprisons and number of levels are log n in merge sort(whether it. Is a best case or worst case).hence mumber o comparisons should be nlogn in worst case as well as best case.

 

Pls guide me.
edited by

2 Answers

0 votes
0 votes
In merge sort whatever may be sequence of inputs average best worst all cases has same nlogn complexity

Each level we need O(n) comaprisons and number of levels are log n in merge sort  is true
0 votes
0 votes

in worst case number of comparisions required  nlogn 

in best case it is half = nlogn/2

Related questions

6 votes
6 votes
3 answers
1
imamitk9 asked Jun 20, 2017
3,363 views
Q . 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)2b)lognc)n-1d)NOTMy doubt is here ,Are we cons...
0 votes
0 votes
3 answers
2
aditi19 asked Oct 6, 2018
1,143 views
what is the recurrence relation for merge sort?
2 votes
2 votes
1 answer
3
Naveen Parihar asked Jun 26, 2018
2,046 views
Given "log n" sorted lists each of size "n/log n",what is the total time required to merge them into one single list.
1 votes
1 votes
1 answer
4
rahul sharma 5 asked Mar 9, 2018
1,317 views
Consider the modified merge sort where we divide array into 5 equal sub arrays instead if 2(as in standard merge sort).What is the time complexity if modified merge sort?...