2,438 views
0 0 votes

Shiva modified merge sort as:

  1. divide the array into 3 equal parts insttead of 2.
  2. sort each part
  3. do a 3 way merge.

What can we conclude about modified  three way  merge sort?

A. It has same worst case complexity as normal merge sort 

B. It has less complexity as comparisons reduces to log 3 level.

C. It is more complex due to 3 way merge

D. The algorithm will not work perfectly for some inputs.

2 Answers

0 0 votes
answer should be A

the recurrence relation will be of this form

T(N)=3T(N/3)+O(N)

by masters theorem it is O(NLOGN)
0 0 votes

Answer should be A,C

FOR ANSWER A

T(N)=3T(N/3)+O(N) time complexity is O(n*log(n)).

FOR ANSWER C

we are dividing element in to three part means increasing divide operation and  perform divide operation is complex.by asymptotic both are take  same  time but by constant it will take more time as compared to original merge sort.It is more complex due to 3 way merge

 

Position:
Show:

Related questions

9 9 votes
2 answers 2 answers
23.4k
23.4k views
0 0 votes
2 2 answers
4.6k
4.6k views
1 1 vote
0 0 answers
2.2k
2.2k views