1,408 views
0 votes
0 votes
Suppose we modify mergesort as follows. We split the input into three equal segments,
recursively sort each segment and then do a three way merge of the three sorted segments to obtain a
fully sorted output.
If we work out the recurrence for this variant, we find that the worst case complexity is O(n log3 n), as
opposed to O(n log2 n) for the usual divide and conquer that splits the input into two equal segments.
Let us call the new version 3-way mergesort. What can we say about the asymptotic worst case
complexity of 3-way-mergesort with the usual mergesort?

a) The asymptotic worst case complexity of 3-way mergesort is better than that of usual
mergesort.

b)The asymptotic worst case complexity of 3-way mergesort is the same as that of usual
mergesort.

c)The asymptotic worst case complexity of 3-way mergesort is worse than that of usual
mergesort.

d)This depends on the length and the initial arrangement of values of the input.

answer given is b.Why?

Please log in or register to answer this question.

Related questions

2 votes
2 votes
1 answer
1
rsansiya111 asked Dec 8, 2021
872 views
Suppose we do merge sort with a three-way split: divide the array into 3 equal parts, sort each part and do a 3 way merge.What would the worst-case complexity of this ver...